Here is my second attempt (hopefully this time it is better then previous) at briefing my structure :
I have two views for index.xhtml :
View 1: Header.xhtml DefaultPage.xhtml Footer.xhtml
In my Header.xhtml, I have menubar which holds reference to index.xhtml with different GET parameter values. Based on my GET parameter value(content_page_to_render), I generate second view as follows :
View 2 : Header.xhtml Page2.xhtml Footer.xhtml
Here are the sample codes for Index.xhtml and Page2.xhtml :
Index.xhtml :
<insert id="header">
<include src="header.xhtml">
</insert>
<insert id="content">
<if test="${content_page_to_render == body1.xhtml}">
<include src="body1.xhtml">
</if>
<if test="${content_page_to_render == body2.xhtml}">
<include src="body2.xhtml">
</if>
</insert>
And my body2.xhtml looks like this : < form id="formId" class="form-horizontal" role="form"> < commandButton action="#{backingBean.method}" value="Submit"/> < /form>
This backing bean method is not being called. However the moment I move this commandButton to index.xhtml (i.e. outside of the included page) then it is working (i.e. the backing bean method is called).
P.S. : 1. Tried to change the action value to garbage and it has no effect, the above behavior doesn't change implying that the action value is not considered at all for some reason. 2. I tried to create a sample JSF project with basic include without multiple views and it worked fine. However, in my actual project the include is not working.
Would request you to help me with the same.
Thanks & Regards, Ravikiran Mane.