myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "...Gargi" <>
Subject disable/enable <h:inputText> dynamically
Date Thu, 12 Jul 2007 20:49:52 GMT

I have an inputText component whose "disable" attribute is bound to a booelan
in the backing bean in request scope.

while the page is loading flag = true. Later when i change the flag to false
(on button click), the inputText component does become enabled, but its
value does not get set in the backing bean.  

JSP code :
<h:inputText id = "input" value = "#{loginBean.text}"  disabled =
<h:commandButton  id = "disable" value = "DISABLE" action =
"#{loginBean.disable}"  />
<h:commandButton  id = "enable" value = "ENABLE" action =
"#{loginBean.enable}"  />

Backing Bean code : 
public String text;
public boolean flag = true;  
public void disable() { this.setFlag(true);}
public void enable() { this.setFlag(false);}
(+ getter-setter methods..)
This is strange because the situation is nto the same when inputText
component is enabled to begin with. In that case it functions as expected.

Solutions/discussions will be appreciated....thanks 

View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message