2013-03-19 10 views
1

我已經在PrimeFaces對話框內測試了Balusc的inputDate組件:Composite component with multiple input fieldsencodeAll方法根本不被調用,並且選擇框未被初始化。如文章中所示,複合組件在放置到表單中時工作正常。encodeAll方法在將複合組件置於PrimeFaces p:對話框內時不會調用

爲什麼encodeAll在對話框內不起作用,如何解決?

編輯1

我用鑽嘴魚科2.1.13和3.4.2 PrimeFaces。

編輯2 以下是我真實項目的示例。我使用你的組件來了解複合組件。我有一個查看帳戶,一個數據表和一個工具欄。按添加應該打開一個自定義嚮導的對話框。該對話框有其自己的形式,但不會顯示該向導。

accounts.xhtml

<h:form id="form"> 
    <ui:include src="/WEB-INF/flows/accounts/accountsTable.xhtml" />  
</h:form> 
<ui:include src="/WEB-INF/flows/accounts/mainDialog4.xhtml" /> 

accountsTable.xhtml

<p:dataTable id="accounts" ... /> 

<p:toolbar> 
    <p:toolbarGroup align="left"> 
     <p:commandButton value="Add" 
      action="#{accountsBean.initializeEntity}" 
      process="@this" update=":actionsDialog4" 
      oncomplete="actionsDialogWidget4.show()"> 
      <f:setPropertyActionListener value="#{2}" 
       target="#{accountsBean.operation}" /> 
      <f:setPropertyActionListener value="accountsBean" 
       target="#{sessionScope.beanName}" /> 
     </p:commandButton> 
    </p:toolbarGroup> 
</p:toolbar> 

mainDialog4.xhtml

<p:dialog id="actionsDialog4" widgetVar="actionsDialogWidget4" dynamic="true" 
    modal="true">  
    <h:form> 
    <costom:actionWizard name="wizard" widgetVar="wiz" bean="#{accountsBean}" header="#{accountsBean.entityHeader}" /> 
    </h:form> 
</p:dialog> 
+0

無法在Tomcat 7.0.37上使用Mojarra 2.1.20和PrimeFaces 3.5進行復制。在將來的問題中,請提及使用的確切庫impl /版本,並且包含[SSCCE](http://stackoverflow.com/tags/jsf/info)。 – BalusC 2013-03-19 12:41:35

+0

添加了庫信息。 – Seitaridis 2013-03-19 12:49:40

+0

現在還是SSCCE。我至少不能用這個最小片段在''中重現它:'' – BalusC 2013-03-19 12:50:41

回答

1

這是由PrimeFaces CoreRenderer在不是要求UIComponent#encodeAll()引起210方法,但分別爲encodeBegin(),encodeChildren()encodeEnd()。所以當它被聲明爲PrimeFaces組件的直接子對象時,它總是會失敗,但當它被聲明爲標準JSF組件的直接子對象時,它將會工作。

如果您在encodeBegin()而不是encodeAll()執行作業,那麼它應該工作。我相應地更新了複合組件文章。

在不相關的說明中,<p:dialog>應該有自己的形式。

+0

謝謝你在那裏。 – Seitaridis 2013-03-27 17:05:29

+0

不客氣。 – BalusC 2013-03-27 18:50:39

相關問題