Meaningless Drivel is fun!
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


sreedhar yadagini

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: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();

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
I agree. Here's the link:
subject: ValueChangeListener
It's not a secret anymore!