This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Dropdown Selected returning unexpected value on submit.
Select Option tag and JSP
Problem while getting the data from the drop down box
Lose of data while getting from the dropdown box
selectOneMenu disabled