2013-07-01 136 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