Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve the selectedItem value from <h:selectOneListBox> tag

 
Anshul Chandra Saxena
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have to develop a <h:selectOneListBox>, wherein there will be 4 items.That is the dropdown will have 4 items. I need to retrieve the value that the user is selecting. I am facing the problem while retrieving the value. Its always coming null.

My Backing Bean is:


The view.jsp is as:


Now, whenever i try to get the selectedValue like



i get a NullPointerException.

Can anyone please help, how to retrieve the selected Value.

thanks
 
Anshul Chandra Saxena
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can anyone please help with this ?

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic