aspose file tools*
The moose likes JSF and the fly likes unable to retrive value from a dropdown menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "unable to retrive value from a dropdown menu" Watch "unable to retrive value from a dropdown menu" New topic
Author

unable to retrive value from a dropdown menu

Ophola Maseti
Greenhorn

Joined: Feb 23, 2012
Posts: 1
hi, i am trying to get a selected item from a select dropdown menu in a dialog and put the value into a setPropertyActionListener that will in turn put it on a textbox of the parent form. when i put a hard-coded value, i can see it on the parent form. it returns a blank when when i am trying to get the selected value from the select dropdown menu, is there something wrong that i am doing?

<select size="1" id="stateSelect">
<option selected="selected" value="on">on</option>
<option value="off">off</option>
</select>
<p:commandButton update="#{p:component('state')}"
onsuccess="myDialog.hide();" value="Update" title="Update status">
<f:setPropertyActionListener target="#{config.connConfig.state}"
value="#{stateSelect.options[stateSelect.selectedIndex].value}"/>
</p:commandButton>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to retrive value from a dropdown menu
 
Similar Threads
Lose of data while getting from the dropdown box
Problem while getting the data from the drop down box
selectOneMenu disabled
Select Option tag and JSP
Dropdown Selected returning unexpected value on submit.