Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HtmlSelectOneMenu

 
Pinal N Patel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings everyone,

I can't get HtmlSelectOneMenu to return the selected value. Please let me know how to correct this problem. Please refer to the code below for review. Basically, I have a drop down menu and a command button. User selects from the drop down menu and clicks on the command button for the action to execute for the selected value from the drop down menu.

System.out.println on the setter method always returns NULL though something was selected from the drop down menu.

Any help is appreciated. Thanks in advance!!

 
Pinal N Patel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, so it works now.

I used method getSubmittedValue() on HtmlSelectOneMenu instead of getValue() to get the selected item from the drop down menu. It turns out, getValue() is used for UIOutput and getSubmittedValue() is used for UIInput.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic