Primefaces对话框架 - 对话框只打开一次

时间:2014-07-01 06:49:40

标签: jsf primefaces

我想在表格行上点击打开一个对话框。它第一次工作(对于每个按钮),但当我关闭对话框(手动,角落里的X)时,它不会在下次显示。刷新页面后,它再次打开。

包含表格的页面:

<h:form>
    <p:dataTable id="dataTable" var="ad" value="#{adsBean.ads}" widgetVar="adsTable" filteredValue="#{adsBean.filteredAds}" selectionMode="single" selection="#{adsBean.selected}" rowKey="#{ad.id}">
        <p:column id="test" headerText="test">
               <h:outputText value="test" />
        </p:column>
        <p:column>
               <p:commandButton icon="ui-icon-search" value="View" action="#{adsBean.viewAd()}" />
        </p:column>
    </p:dataTable>
</h:form>

我的对话

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" >

<h:head>
</h:head>

<h:body>
    dialogcontent
</h:body>
</html>

AdsBean.viewAd

public void viewAd() {
    Map options = [
        modal: true
        ,draggable: false
        ,resizable: false
        ,contentHeight: 470
        ,contentWidth: 620
        ,width: 650
        ,height: 500
    ]
    RequestContext.getCurrentInstance().openDialog("fragments/index/viewAdDialog", options, null);
}

有任何想法如何解决这个问题?

0 个答案:

没有答案