PhaseListener afterPhase(), getViewRoot() children are empty

I have a PhaseListener which has a phaseId = PhaseId.RESTORE_VIEW. However in the afterPhase() is there a reason that the UIViewRoot object is not populated with UIComponents? Or is my understanding not right? I need to access UIComponents asap from the viewRoot!!
[285 byte] By [Pro-grammera] at [2007-11-27 9:12:33]
# 1
On every phase you can get UIComponents of viewroot likee.getFacesContext().getViewRoot().getChildren(); returning the list of UIComponents
spywherea at 2007-7-12 21:59:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

The very first page load in a fresh session won't show the components during the RESTORE_VIEW, simply because there is no previous view to be restored. Refresh the client (F5 in the browser) at least once and then you'll see the components.

For your purposes you prolly better have to set the PhaseId to RENDER_RESPONSE.

Also see http://balusc.xs4all.nl/srv/dev-jep-djl.html to get some more insights in the JSF lifecycle.

BalusCa at 2007-7-12 21:59:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...