Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating model relationship using h:selectOneListbox

 
Lonnie Lewis
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am populating a table (h:dataTable) with a Hibernate managed collection. The table is populated fine using:


When I make a change to the "make" in this example and submit the form, the "make" field is correctly updated for the appropriate object in the collection.

My problem is in updating the "carCondition" using the h:selectOneListbox. I can understand why it wouldn't work; changing the "id" field in the embedded "carCondition" object, when I would really want the database relationship changed.
How should this best be done? Am I missing an easy way to do this or in my "actionListener" method should I just read the form parameters, find the correct value (the selected "carCondition" id), find the correct CarCondition object and update the "car" object myself? Is there an easier way?
 
Karim Sherif
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANK YOU
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic