• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

ValueChangeListener

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
y wont u use the pure java script if it is entrirley Client Side...
using getelementById("formId:ControlID").style.display = "none" or inline
 
reply
    Bookmark Topic Watch Topic
  • New Topic