0 Replies Latest reply on Dec 28, 2012 12:50 PM by javaxchange

    JSF Rendering & Performance

    javaxchange

      Hi,

       

       

      I am using the below code snippet to render my pages based on certain conditions

       

       

      <h:form>

         <ui:fragment rendered="#{mybean.pageName eq 'CourseType'}">

             <ui:include src="/pages/courseTypePage.xhtml />

         <ui:fragment>

         <ui:fragment rendered="#{mybean.pageName eq 'ContainerType'}">

             <ui:include src="/pages/containerTypePage.xhtml />

         <ui:fragment>

        <ui:fragment rendered="#{mybean.pageName eq 'MenuType'}">

             <ui:include src="/pages/menuTypePage.xhtml />

         <ui:fragment>

          ..........................................................

          ..........................................................

      </h:form>

       

       

      I have many pages like this. I wanted to know,

       

       

         1. Exactly how rendered="false" attributed componet works in clientside and server.

         2. If I use rendered attribute like above, is it a performance hit.Because even if only 1 page is getting rendered, I found it is validating all the pages I have included here when loading the above page. If any invalid code or duplicate id in any of the pages above with rendered attribute value evaluated to false is giving me error.

         2. In the DOM tree, all the pages and its components will be there?

       

       

      I tried to build the pageUrl dynamically. but because of some other issues, it is not working fine.

       

       

      Can anyone give some light on this. If there is a better approach, could you please suggest.

       

       

      Any help will be greatly appreciated.

       

       

      Thanks,

      Sreejith