ModalPanel with dynamically rendered a4j:include using rende
mtaal Dec 11, 2007 6:01 AMHi,
I try to create a modalpanel with a a4j:include which is conditionally rendered. The modalpanel is opened when a link is clicked and at that point the a4j:include should be rendered.
The reason that it should be rendered then is that I noticed that the a4j:include is also rendered when the modalpanel is hidden (when the whole page is displayed) and this results in an error (because not all information in backing beans is set at that time).
Another reason for dynamic rendering of the a4j:include is that then I can pass the viewid as a parameter.
My problem is that the a4j:include is not rendered, I also tried it with a simple output text and is was neither rendered. I checked and the rendered property is true (at least the backing bean has the value true).
I use seam 2.0 and the 3.1.3 snapshot of saturday.
Here is the model panel code:
<rich:modalPanel id="SearchBookAuthor"> <f:facet name="header"> <h:outputText value="Test" /> </f:facet> <f:facet name="controls"> <h:graphicImage value="/gfx/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('SearchBookAuthor')" /> </f:facet> <a4j:outputPanel id="SearchBookAuthorPanel"> <a4j:outputPanel id="outputPanel" rendered="#{entityHome.isShowModalPanel('BookAuthor')}"> <a4j:include viewId="/pages/library/WriterSelect.xhtml"/> </a4j:outputPanel> <h:outputText value="TEST ME" /> <h:outputText value="TEST ME2" rendered="#{entityHome.isShowModalPanel('BookAuthor')}"/> </a4j:outputPanel> </rich:modalPanel>
And here is the code to open the modal panel:
<h:outputLink id="SearchBookAuthorLink" rendered="#{entityHome.formMode!='delete'}"> <h:graphicImage value="/gfx/search.gif" /> </h:outputLink> <a4j:support event="onclick" limitToList="true" ajaxSingle="true" reRender="SearchBookAuthorPanel" disableDefault="true" rendered="#{entityHome.formMode!='delete'}" oncomplete="javascript:Richfaces.showModalPanel('SearchBookAuthor', {uri:'/pages/library/WriterSelect.xhtml'});"> <a4j:actionparam name="modalPanelName" value="BookAuthor" assignTo="#{entityHome.showModalPanel}" /> <a4j:actionparam name="entityName" value="Writer" assignTo="#{entityList.entityName}" /> <a4j:actionparam name="maxResults" value="15" assignTo="#{entityList.maxResults}" /> </a4j:support>
Thanks for any help on this.
gr. Martin