Modifying JSF Component Tree in PhaseListener

Posted by jamiebarrow on Stack Overflow See other posts from Stack Overflow or by jamiebarrow
Published on 2010-03-18T10:28:44Z Indexed on 2010/03/18 10:31 UTC
Read the original article Hit count: 339

Filed under:
|
|
|
|

Hi all,

I'm having an issue.

I've implemented a PhaseListener, which is meant to add a style class to any UIInput components in the tree that have messages attached to them, and removes the style class if it doesn't have any messages attached to them.

The PhaseListener runs in the RENDER_RESPONSE phase, and does it's work in both the beforePhase and afterPhase methods while debugging. While debugging, I found that beforePhase doesn't have access to the full component tree, but afterPhase does. Any changes done in afterPhase aren't rendered though.

How do I go about this? I want this to be completely server side.

Thanks,

James

© Stack Overflow or respective owner

Related posts about jsf2

Related posts about phase