myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "...Gargi" <garg...@gmail.com>
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 =
"#{loginBean.flag}"/>
<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: http://www.nabble.com/disable-enable-%3Ch%3AinputText%3E-dynamically-tf4070769.html#a11568580
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message