Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble getting value of selectOneMenu  RSS feed

Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,

I am having trouble receiving a select box's value at the back end. My requirement is that the user can search a person on the basis of userid ( uid) or last name or id, so I created a select box ( searchTypeSelect) for that. now the user specifies the keyword in a text box and on the basis of the combination of this text and searchTypeSelect, I have to populate another list box ( uidSelect). for the time being I have created arrays of values in the javascript and I populate this list box ( uidSelect) from those arrays. Now the user can select any of the options populated and clicks submit and then I navigate it to the managed bean method.
but my problem is that I am not able to get this box ( uidSelect)'s value in the backed bean method. Actually if I use empty selectOneMenu and then I populate it from the javascript, it doesn't go to the backbean method, the page just gets refreshed. If I hard code some values in the selectOneMenu, then if I choose any of the hardcoded options, then the control goes to the back bean method otherwise don't. I don't know what is wrong with my code.

I tried to upload my code, but this site is not letting me post it. please send me your email and I can send you the file there.

is there any way I can use either html <select> or selectOneMenu and get the value in the backed bean method? Is it possible to get an html select's value at the back end in JSF?
can somebody tell me what is problem here?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!