myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: Change visibility dinamically
Date Tue, 27 Feb 2007 20:36:41 GMT
Yes I know, using rendered, valueBinding and managed bean I can do it,
but to use these options I have to project the application to managed
this cases. Suppose I have developed an application and in a page I have
a textbox that, at develop design, noone supposed this component could
be hide in some the text box is always rendered. In this
case I don't have no programmatic "if" and no EL expression. How can I
hide this texbox without modify the code? I  was thinking to implement a
my UIViewRoot, override the component in faces-config to force to use my
UIViewRoot and put inside my UIViewRoot all the it
possible? Is it correct?

-----Original Message-----
From: Mike Kienenberger [] 
Sent: 27 febbraio 2007 21.23
To: MyFaces Discussion
Subject: Re: Change visibility dinamically

Oops.  You're right, Simon.   It could be set programmically.   I
still think it's a bad design, but that's just my opinion.

On 2/27/07, Simon Kitching <> wrote:
> 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
> 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
>   setRendered, there is no way to go back to using an EL expression.
> other words, once you've decided to manually control the rendered
> 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
> > of a managed bean (unless you're using facelet functions or
> > 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
> > maybe we can help you more.
> >
> >
> > On 2/27/07,
> > <> 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
> >> in my
> >> Managed Bean but externally. May be implementing a Phase Listener
> >> help
> >> me to do this? In wich Phase should I set the visible property of
> >> components?
> >>

This message is for the designated recipient only and may contain privileged, proprietary,
or otherwise private information.  If you have received it in error, please notify the sender
immediately and delete the original.  Any other use of the email by you is prohibited.

View raw message