This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Binding object in a selectMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Binding object in a selectMenu" Watch "Binding object in a selectMenu" New topic
Author

Binding object in a selectMenu

Dennis John
Greenhorn

Joined: Jan 30, 2004
Posts: 10
Hello, I am trying to bind an object to the value property of a selectOneMenu but cannot get it working. It does work, however, when I bind an object of type Long.

I get a conversion error where it tells me I cannot convert object@address to null. Any thoughts on if this is possible and what I am doing wrong? Here is my code.

jsp page
<h:selectOneMenu value="#{projectManager.customerId}" valueChangeListener="#{projectManager.getProjects}" onchange="submit()">
<f:selectItems value="#{projectManager.customers}"/>
</h:selectOneMenu>


Dennis John
Greenhorn

Joined: Jan 30, 2004
Posts: 10
Sorry, that is the code that works. The code that doesn't looks like this.

jsp page
<h:selectOneMenu value="#{projectManager.customer}" valueChangeListener="#{projectManager.getProjects}" onchange="submit()">
<f:selectItems value="#{projectManager.customers}"/>
</h:selectOneMenu>

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Binding object in a selectMenu
 
Similar Threads
JSF + PrimeFace: Validation Error: Value is not valid
how to obtain list object from an actionform
datatables and selectOneMenu default Value Problem
comboBox sends 0 when left empty
Bean Value is always Null