2013-07-01 138 views
0

嗨,你们primefaces的对话框不再显示。这是我的代码。请帮忙,我做错了什么。 这是代码,我叫出从列标题为 '更多':primefaces对话框不显示

<h:panelGrid columns="2"> 
    <p:dataTable id="tbl" var="holder"> 
    ... 
    <p:column> 
        <f:facet name="header"> 
         <h:outputText value="More"/> 
        </f:facet> 
        <p:commandLink value="more" type="button" styleClass="ui-icon ui-icon-search" actionListener="#{editCustomerView.viewCustomerInfo}" update=":content_form:customerInfoDialog" oncomplete="_cusInfoDlg.show()"> 
         <f:attribute name="currentCustomer" value="#{holder}"/> 
        </p:commandLink> 
    </p:column> 
    ... 
    </p:dataTable> 
    </h:panelGrid> 

//dialog is here 

    <p:dialog id="customerInfoDialog" widgetVar="_cusInfoDlg" header="Зээлдэгчийн мэдээлэл"> 
      <ui:include src="#{editCustomerView.infoPage}.xhtml"/> 
      <h:commandButton value="ok" styleClass="btn" style="width: 100px; float: right; margin-right: 20px; margin-bottom: 20px;" onclick="customerInfoDlg.hide(); return false;"/> 
    </p:dialog> 

这里通过

public void viewCustomerInfo(ActionEvent event) 
{ 
    this.currentCustomer = (Customer) event.getComponent().getAttributes().get("currentCustomer"); 
    this.currentCustomerAddress = prepareCurrentCustomerAddress(this.currentCustomer); 

    if(this.currentCustomer.isIsCitizen()){ 

     this.infoPage = "CitizenInfo"; 


    } 
    else 
    { 
     this.infoPage = "OrganizationInfo"; 
    } 
} 
+0

我解决了后台bean的ActionListener方法它通过向dialog添加dynamic ='true'。但为什么这样解决? – Odgiiv

+0

如果您从' Daniel

+0

你是否从旧版本迁移到新版本? – Kukeltje

回答

0

我通常打开的对话框的Javascript

PF('_cusInfoDlg').show(); 
+0

请澄清为什么你这样做,因为在OP的例子中,它也是通过javascript在oncomplete中打开的! – Kukeltje