Not sure what you mean, Mike.

Every UIComponent has a setRendered(boolean) method that can be called to specify whether that component is rendered or not. This method could certainly be called from a PhaseListener.

Note that there is a slight flaw in the design of this method in my opinion; the rendered property can be specified as either an EL expression (ie stored as a ValueBinding) or can be a literal value set via setRendered(). If a value-binding is used then setRendered() can later be used to override that; however once rendered has been set using setRendered, there is no way to go back to using an EL expression. In other words, once you've decided to manually control the rendered state you cannot go back to using the original EL rendered expression.

One way around this would be to use
  // create a ValueBinding for the expression #{true}
  setValueBinding("rendered", vb);
rather than
  setRendered(true);

Cheers,

Simon

Mike Kienenberger wrote:
You can only set the rendered property of a component from the values
of a managed bean (unless you're using facelet functions or customized
el resolvers).   Your managed bean can call whatever java code you
want it to.

If you give more specific details of what you're trying to accomplish,
maybe we can help you more.


On 2/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:




I wanna change the behavior of my application changing the visibility of
some component basing of specific rules but I don't wan put this logic in my Managed Bean but externally. May be implementing a Phase Listener can help
me to do this? In wich Phase should I set the visible property of my
components?

Reply via email to