We would like some advice on how to reorganize the layout of components inside a JSF view.
We are currently developing a JSF-based framework. This framework will be used internally to develop large web applications with up to several thousand views (pages). The views will be written as Facelets XHTML files.
We want to be able to modify the visual aspect of the page, so that the page actually shown to the user is a little different from what the developer described in the XHTML file. We wish to do this for at least two reasons :
1) The actual position of some components on one given page may vary from customer to customer.
2) Long term evolution of our applications might require subtle changes to the layout of some components in the page.
Therefore, we wish the developer to position the components at a place which is a good description of the view (for instance, placing a list pagination button next to the list component itself), and have our framework move that component at the place where the customer wishes it to be (for instance, in some sort of button toolbar).
We have tried two ways of doing this, so far :
1) Actually reorganize the component tree after creation. We never actually managed to get this working correctly.
2) Rendering components out of turn (that is, a placeholder component at the target location asks the original component to render itself). We actually managed this on a simple example (moving buttons to the bottom of the page).
We need to understand :
* What is the best way achieve this using JSF ? (as in : reliable, and as true to the spirit of JSF as possible)
* What is actually possible ?
* What are the pitfalls ?
Note that, for various reasons, we will *not* consider approaches such as generating the XHTML from some other higher-level description language, or moving components using JavaScript or CSS. We want the developers to write facelets pages, and we do not want to pollute the generated HTML with layout tricks.
[Message sent by forum member 'yvalot' (yvalot_at_sopragroup.com)]
http://forums.java.net/jive/thread.jspa?messageID=384982