modalPanel + region +rendering
shooali Feb 10, 2008 12:43 PMHello,
I have the following problem:
I have a page that has a modalPanel defined in it, outside of the page form. in the modal panel content I use a4j:include to include another xhtml that contains the modalpanel content. in the modal panel xhtml, there is another form, which inside of it I use a4j:support to catch an 'onclick' event and to reRender another component on that same modalpanel xhtml.
the problem is that whatever I do, the a4j/richfaces components on the main page gets reRendered as well. putting a4j:region selfRendered=false and/or a4j:outputPanel ajaxRendered=flase on the main page, and/or limitToList=true on the a4j:support on the modalPanel page, does not help.
What am I missing?
I am using rich3.1.2GA, myfaces 1.2 and facelets 1.1.13.
please find attached a code example
main page:
<ui:composition>
<a4j:region>
<rich:modalPanel id="modalPanel" width="400" height="300">
<f:facet name="header"><h:outputText value="Modal Panel"/></f:facet>
<f:facet name="controls">
<a href="#" style="cursor:pointer" onclick="Richfaces.hideModalPanel('modalPanel')">X</a>
</f:facet>
<a4j:outputPanel ajaxRendered="false">
<a4j:include viewId="modalPanel.xhtml"/>
</a4j:outputPanel>
</rich:modalPanel>
</a4j:region>
<h:form>
<a4j:commandLink
value="open modal panel"
onclick="Richfaces.showModalPanel('modalPanel');"/>
<h:panelGroup>
<a4j:outputPanel ajaxRendered="false">
<a4j:repeat value="#{mainBean.items}" var="item">
<h:outputText value="#{item}"/>
</a4j:repeat>
</a4j:outputPanel>
</h:panelGroup>
</h:form>
</ui:composition>
modalPanel:
<ui:composition>
<a4j:form id="mp_form">
<a4j:region>
<h:outputText value="hello">
<a4j:support event="onclick" reRender="description" onsubmit="alert('onsubmit')" limitToList="true"/>
</h:outputText>
</a4j:region>
<h:outputText
id="description"
value="#{richTestBean.description}"/>
</a4j:form>
</ui:composition>
clicking the hello text will result in creating a new instance of the mainBean and the getItems property called.
Thanks