myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rene van Wijk <>
Subject RE: Rendered Property
Date Tue, 21 Jul 2009 13:46:30 GMT

During the restore view tour managed bean might return false, so JSF cannot bind the action
to the commandbutton. Is it a problem is you use the disabled attribute instead of the rendered
-----Original message-----
From: SANTINI, Rafael <>
Sent: Tue 21-07-2009 15:31
Subject: Rendered Property


In the following code, the last two components are rendered on the condition 
"#{bean.campo1 != null}". When the bean.campo1 is different that null, they 
are displayed. But, when the last button is clicked, the testar method is 
not invoked. What I'm missing?

 <h:inputText value="#{bean.campo1}"/>
 <h:commandButton value="OK"/>
 <h:inputText value="#{bean.campo2}" rendered="#{bean.campo1 != null}"/>
 <h:commandButton value="Testar" action="#{bean.testar}" 
rendered="#{bean.campo1 != null}"/>

public class Bean {

   private String campo1;

   private String campo2;

   public String getCampo1() {
       return campo1;

   public void setCampo1(String campo1) {
       this.campo1 = campo1;

   public String getCampo2() {
       return campo2;

   public void setCampo2(String campo2) {
       this.campo2 = campo2;

   public void testar() {
       campo2 += "_OK";



Rafael Santini 

View raw message