File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How to retrieve the selectedItem value from <h:selectOneListBox> tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to retrieve the selectedItem value from <h:selectOneListBox> tag" Watch "How to retrieve the selectedItem value from <h:selectOneListBox> tag" New topic
Author

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

Anshul Chandra Saxena
Greenhorn

Joined: Sep 10, 2009
Posts: 14
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

Joined: Sep 10, 2009
Posts: 14
Hi

Can anyone please help with this ?

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