[jboss-user] [JBoss Seam] - @DataModel outjection problem

cavani do-not-reply at jboss.com
Fri Dec 15 07:18:21 EST 2006


I have one field outjected by @DataModel annotation on SFSB on a long conversation. This field is a List of Entity  Beans (query populated). When user click to add, I put a new instance on list and outject this instance for editing. On save action, I persist this instance and query again, but the equals/hash don't change because database id isn't relevant for equality. When user try edit this entry, save duplicate the entry (just in this case).

I figured out the problem is (from @DataModel JavaDoc):

anonymous wrote : 
  | (...) Note that the List, Map, Set or array will be re-wrapped and re-outjected each time the current component value is different to the value held by the context variable as determined by calling equals() on the underlying collection.
  | (...)
  | 

My solution was: (before query again on save)


  | Contexts.getConversationContext().remove("myList");
  | //...
  | 

Is possible do this simpler or more manageable?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994202#3994202

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994202



More information about the jboss-user mailing list