HI Martin,
 
  Thanks for your quick reponse. I have tried it. It didn't work for me. It should. I must have done something wrong. For example,
 
       public MyBean {
           private boolean rendered = true;
 
           public void setRendered(boolean r) { ...}
           public boolean getRendered() {}
 
           public void selectionChanged (ValueChangeEvent event) {
                 setRendered (false);
           }
       }
      
then I did 
       <h:inputText id="one" value= "abcdefg" rendered="#{myBean.rendered}"/>

When the  <h:selectOneMenu ../> changes the value, I have set the render to be false. But it is always showing. I would like it to not showing when change the selection. Anything wrong?
 
Thanks,
Emily

 
On 12/15/05, Martin Marinschek <[EMAIL PROTECTED]> wrote:
Yes you can.

what you'd actually do is use the rendered attribut on the input-text
itself, such as:

<h:inputText id="one" value= "abcdefg" rendered="false"/>

and instead of just putting false there, you'd use a value-binding:

<h:inputText id="one" value= "abcdefg" rendered="#{ myBean.oneRendered}"/>

The getter-method of this property would need to return true or false,
depending on if you want this component to be rendered.

(if you have a special usecase so that you need the panelGroup around
the inputText - no problem, this will work as well...)

regards,

Martin


On 12/15/05, Emily Gu <[EMAIL PROTECTED]> wrote:
> HI,
>
>   Can we use the "rendered" attribute to show and hide some components? Such
> as:
>
>        <h:panelGroup id="box" rendered="false">
>            <h:inputText id="one" value= "abcdefg" />
>       </h:panelGroup>
>
>    The input text box can be shown and hidden by setting the rendered
> attubute?
>
> Thanks!!


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to