In a primefaces dialog I show a form with some input fields initially. If the user clicks a button an image or pdf is opened and the dialog is separated with a p:layout. For this I include the rendering of the input fields inside editProperty.xhtml and include it two times in the dialog. Inside a panelGroup to show input fields only and also inside a p:layout. I excluded the panelGroup and the layout with the rendered attribute. So my expectation is that only the dialog is shown with the layout or with the panelgroup. The initial UI shows it without the p:layout but the fields are rendered twice.
<o:form id="editPropertyFormId">
<p:dialog id="editPropertyDialogId" widgetVar="editPropertyDialogVar" modal="true">
<!-- <c:if test="#{editPropertyContentBL.isContentViewerCollapsed() == false}"> -->
<p:layout id="editPropertiesLayoutId" style="width: 100%; height: 100%;" onResize="adjustContentViewerSize();"
widgetVar="editPropertiesLayoutVar" rendered="#{editPropertyContentBL.contentViewerCollapsed == false}">
<p:layoutUnit id="editPropertiesFieldsLayoutId" position="west" resizable="true" size="400"
style="padding-right: 5px !important;" collapsible="false">
<ui:include src="/sections/edit/editProperty.xhtml">
<ui:param name="idPrefix" value="editPropsInLayout" />
<ui:param name="editPropertyBLInstance" value="#{editPropertyBL}" />
<ui:param name="editPropertyContentBLInstance" value="#{editPropertyContentBL}" />
</ui:include>
</p:layoutUnit>
<p:layoutUnit id="editPropertiesContentViewerLayoutId" position="center" resizable="true"
styleClass="contentViewerLayout">
<ui:include src="/sections/content/contentViewer.xhtml" />
</p:layoutUnit>
</p:layout>
<!-- </c:if> -->
<!-- <c:if test="#{editPropertyContentBL.isContentViewerCollapsed() == true}"> -->
<h:panelGroup rendered="#{editPropertyContentBL.contentViewerCollapsed == true}">
<ui:include src="/sections/edit/editProperty.xhtml">
<ui:param name="idPrefix" value="editProps" />
<ui:param name="editPropertyBLInstance" value="#{editPropertyBL}" />
<ui:param name="editPropertyContentBLInstance" value="#{editPropertyContentBL}" />
</ui:include>
</h:panelGroup>
<!-- </c:if> -->
</p:dialog>
If I use c:if (uncommented in the code), it seems that the ui:parameter does not work because an update inside editProperty.xhtml does not work:
<p:inputText id="#{idPrefix}editPropertyChoiceListValueId"...
<p:commandButton update="#{idPrefix}editPropertyChoiceListValueId"
I get an exception that "editPropseditPropertyChoiceListValueId" cannot be found. Probably there is problem with ui:include/ui:param inside c:if?
Thanks Oliver