Challenge: Generically Setting UI Component Properties
Hello,
had a challenge to set UI components properties implicitly instead of specifying each property name and value: For instance, having LayoutPanel to set all the text and drop-down boxes on it disabled.
I've found a nice article how to do this(http://blogs.sun.com/david/entry/generically_setting_ui_component_properti es#comments).
The only problem still remain is how to get parent component children before page gets rendered first time:
Scenario/Description:
1. First time navigation from JSF page to JSF page.
2. UIViewRoot object for the new page is created but not filled in neither in beforeRenderResponse() nor prerender() method. For instance, putting the following (this.getPage1().getChildren();) in the beforeRenderResponse() or prerender() will always return empty list when it is first time the required page get requested.
3. I've found out the UIViewRoot gets filled in ViewHandlerImpl class (line 311 - JSC 2.1). But this method is called -after- prerender() method but -before- afterRenderResponse() one.
4. Same time it is not possible to set components attributes in afterRenderResponse() method because rendering process is already finished and these changes will be applied only during restore view phase next time (see 5).
5. To make this happen user have to generate postback to the same page again.
Any idea how to make it work during -first- time page rendering ? :))))
Kind regards,
Alex

