• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which JSF component to use?

 
Angus Rose
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am building a page based on JSF/MyFaces. It is split into 2 areas - on the left a tree navigation structure and on the right an area in which the selected page (from the tree) will be rendered. So, if a user selects a link, the page is rendered opposite while the tree is still visible.

My question is: which is the best JSF/MyFaces component to use to render the pages, bearing in mind that the source for the page will be read from a backing bean?

Thanks in advance

Angus
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding your question for which component to use, it depends on what component(s) you plan to render on to the browser. Usually you can have a JSF datatable component, that will render as an "TABLE" in the html world.

Probably you can have 2 frames. One frame for the left and the other for the right.

This approach works well if the left frame data is driving the right frame or viceversa.

If you have a transaction happening on one frame, and submit that frame, but need to have the updated results in both the frames, then this might result in a non-deterministic behaviour. Since each request to the server will be a different request, and there is no guarantee which one will get completed first. So one would have to do depend on some hacks in the javascript.(using onload() functions.)
 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Angus Rose:
Hi All,
I am building a page based on JSF/MyFaces. It is split into 2 areas - on the left a tree navigation structure and on the right an area in which the selected page (from the tree) will be rendered. So, if a user selects a link, the page is rendered opposite while the tree is still visible.


Hi Angus,

You could consider using Tiles with your application. Tiles is a layout templating mechanism that can be used in Struts or in JSF. You define one tile to hold the tree, one tile for the main page and put the tree tile on the LHS and the main tile on the right.

While this is not a JSF component per se, it is probably exactly what you need. See MyFaces tiles support for more info.

HTH,

Fintan
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18281
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the examples in this article to get started with Facelets tiling. My layout was almost identical to Angus'. It works great. The actual partitioning of the page is being done via CSS absolute boxes matched to the IDs of <div> tags defined in the templates.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic