2

I have one big JSF page containing nearly 1000 lines using normal JSF forms and panelGrids. It would be easier if i keep them in several pages and integrate them as a single page. I would like to know how I can accomplish this in JSF.

I have several forms in that page, in which most of them are prependID="false" etc. Will that affect the flow of the page if I partition the page as several submodules?

I am using ajax extensively and mostly I update one form component from another form component.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Selvin
  • 12,333
  • 17
  • 59
  • 80
  • @BalusC that was using Facelets, implemented with JSF 2.0- Mojarra 2.0.2, NetBeans 6.8 – Selvin Mar 19 '11 at 09:07
  • Related: [How to include another XHTML in a XHTML using Facelets?](http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets) – BalusC Mar 21 '11 at 19:32

1 Answers1

2

You can split your large page in several files and use <ui:include> to merge the blocks. The <ui:include> has no effect on the component tree so this is a pure construction and compositon tool.

<ui:include src='part1.xhtml'/>
<ui:include src='part2.xhtml'/>

Read the following article to know more about all that: JSF 2 fu, Part 2: Templating and composite components

ciceron
  • 586
  • 5
  • 10
  • Thanks for your short and clear answer. I know there is a way to create composite components using NetBeans 6.8. But i dont know how to create this ui:include? I mean, where/how should I define the `part1.xhtml` contents? – Selvin Mar 21 '11 at 05:25