aspose file tools*
The moose likes JSF and the fly likes ValueChangeListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "ValueChangeListener" Watch "ValueChangeListener" New topic
Author

ValueChangeListener

sreedhar yadagini
Greenhorn

Joined: Mar 23, 2006
Posts: 1
I got a dropdown box and a inputtext box and based on the selection of the dropdown box the input box is enabled/disabled. I am using the JSF and using the valuechangelistner with the h:selectOneMenu. The code snippet is as follows

<h utputLabel for="morningstar">
<h:selectOneMenu valueChangeListener="#{morningStarBean.processValueChanged}" immediate="true" onchange="submit()" value="morningstar" styleClass="values">
<f:selectItem itemValue="blank" itemLabel="" />
<f:selectItem itemValue="TwoFifty" itemLabel="$250.00"/>
<f:selectItem itemValue="ManualEntry" itemLabel="Manual Entry"/>
</h:selectOneMenu>
<h:inputText value="#{morningStarBean.newValue}" required="false" disabled="#{morningStarBean.result}" size="6" maxlength="6"/>

and the bean looks like this

public void processValueChange(ValueChangeEvent event) throws AbortProcessingException{
newValue= (String)event.getNewValue();
System.out.println(newValue);
FacesContext.getCurrentInstance().renderResponse();
}

But it's not helping me in anyway. It's not getting the changed value based on which I enable or disable the text box. Any help would be highly appreciated.
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

y wont u use the pure java script if it is entrirley Client Side...
using getelementById("formId:ControlID").style.display = "none" or inline


Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
 
 
subject: ValueChangeListener