1 Reply Latest reply on Aug 20, 2009 10:16 AM by ilya_shaikovsky

    conditional include: problem regarding ajax and the rendered

    shino

      Hi all,
      I have the problem that there are 5 modal panels in my application which are all ui:included at the main page of the application. Therefore all these panels and their backing beans are initialized when the portlet first loads and are included, though invisible, into the html-page presented to the user.
      In order to increase performance I want those modal panels only to be included into the page when they are needed. At the same time, I don't want to reload the full page to achieve this.

      The scenario I have in mind looks like this: the user clicks on a a4j:commandlink like this one:

      <a4j:commandLink
      ajaxSingle="false"
      value="#{dpd:getResource('ADDRESSBOOK_OVERVIEW_SEARCH_EXTENDED_LBL')}"
      oncomplete="#{rich:component(addressSearchFormBacking.modalID)}.show()"
      reRender="#{addressSearchFormBacking.modalID},testSearch" type="button" >
      <f:setPropertyActionListener
      value="true"
      target="#{renderingController.renderAddressSearchModalPanel}" />
      </a4j:commandLink>


      which refers to this component

      <h:panelGroup id="testSearch" rendered="#{renderingController.renderAddressSearchModalPanel}">
      <ui:include src="addressSearchFormMP.xhtml">
      <ui:param name="param_ReRender"
      value="ADDRESSBOOK_TABS_FORM_1,ADDRESSBOOK_TABS_FORM_2,ADDRESSBOOK_TABLE_FORM" />
      <ui:param name="param_FieldsetCSS" value="addressFormFieldset" />
      </ui:include>
      </h:panelGroup>
      


      The server then includes the new html-fragment for the modalpanel in its response and.. .. somehow .. works it into the existing page.. hopefully.

      But it doesn't seem to work. Perhaps I got something wrong about how the rendered attribute works, if someone could give me a clue as to what I'm doing wrong here I'd be very grateful.

      Thanks in advance
      Chris