dcsimg
JSF Rendering and Performance hit
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sreejithps
Posted On:   Friday, December 28, 2012 10:02 AM

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> .......................................................... ................   More>>
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. If I use rendered attribute like this, 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    <<Less
About | Sitemap | Contact