Meaningless Drivel is fun!*
The moose likes JSF and the fly likes selectOneMenu and Entity beans (JSF & JPA) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "selectOneMenu and Entity beans (JSF & JPA)" Watch "selectOneMenu and Entity beans (JSF & JPA)" New topic
Author

selectOneMenu and Entity beans (JSF & JPA)

Brendan Speer
Greenhorn

Joined: Sep 18, 2008
Posts: 2
His has got to be a 'solved' problem before, but I can't seem to come up with the correct combination of google terms to get the answer.

I have a Datatable filled in by a OneToMany relationship off of an Entity(QAHeader) bean. One of the fields in this Entity(QALine) points to another Entity(LineType). I would like the make a selectOneMenu that selects one of the LineType Entities and set the QALine l_type to that Entity.

After some preliminary research, I found out that I have to use a converter. So I wrote a converter to take a string of the LineType ID and return the Object.

*edit* I forgot to mention that the Converter is registered in faces-config.xml

Now I'm getting: Whenever I submit the page, whether I have changed the values or not.

Everywhere I put debug statements the values seem to be valid.

Can anyone point me to a solution?

Datatable:


Converter:


Here's the function that builds the SelectItem List:


faces-config.xml

[ September 18, 2008: Message edited by: Brendan Speer ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: selectOneMenu and Entity beans (JSF & JPA)
 
Similar Threads
Converter and richfaces orderingList
problem to submit the form when populate the <h:selectOneMenu> using javascript
list shuttle exception
Validation Error on SelectOneMenu
Problem With selectOneMenu