set a HtmlOutputText invisible

Dear all,I have a Faces Portlet and want to set a HtmlOutputText invisible after a user clicks on a button.How to do this?Thank you in advance!
[171 byte] By [Frucadea] at [2007-10-2 23:50:28]
# 1
use rendered attribute
pringia at 2007-7-14 16:35:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

first I tried to set it in the jsp-file:

...

<h:outputText styleClass="outputText" id="text2" rendered="false" value="# {msg.loginQuery_enterUsername}"></h:outputText>

...

but then it didn't pick the value from the bean.

after I tried to set the HtmlOutputText not to be rendered in the action-method but I got a NullPointerException.

...

public String doButton1Action() {

...

text2.setRendered(false);

...

return "";

}

Message was edited by:

Frucade

Frucadea at 2007-7-14 16:35:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
How do you get the component (text2)?public String doButton1Action() {...text2.setRendered(false);...return "";}You don't have any binding to access it directly...
pringia at 2007-7-14 16:35:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thank you for your help!!!The problem was that I accessed the variable "text2" without its getter-method. Now I changed to ...getText2().setRendered(false);...and it works properly!Thank you very much!
Frucadea at 2007-7-14 16:35:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...