Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on Facelets

 
Joe Harry
Ranch Hand
Posts: 10123
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Are Facelets View Definition language something similiar to tiles templating that we do in Struts?
 
Bart Kummel
author
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Facelets does have a templating mechanism, both on page level and on component level. I do not have experience with Tiles myself, so I can't tell you how Facelets' templating mechanism compares to Tiles.

Best regards,
Bart
 
Tom Fulton
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's pretty similar conceptually, with one major difference: Tiles has the ability to "inherit" layouts, while Facelets does not. Apart from that, they can be used in much the same way...create an overall layout, plug in content pages, etc. One difference is that way in which parameters are passed around...in Tiles, you have the tiles scope, but in Facelets you have the ability to specify parameters that are passed through. Again, conceptually similar, with a difference in technique.

Facelets also has something that does not really exist in Tiles: composition components. Suppose you notice a recurring visual effect on a number of pages (such as columns in a data table, or rows in an input form). You can create a component that captures that common structure, re-use it wherever necessary, passing it parameters to tune it to a particular use.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18157
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried to use Tiles in Struts. I have tried to use Tiles in JSF. I've always given up. To me, Tiles requires too much work to define everything properly. YMMV.

The Facelets component-building feature is quite useful. I've got several projects where I've used it to good effect. One of them has a lot of pages that have a small scrollable "help control" in them, and I built the "help control" as a component that gets passed the help topic ID as a parameter..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic