Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Binding object in a selectMenu

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic