• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to retrive value from a dropdown menu

 
Ophola Maseti
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic