[jboss-user] [JBoss Seam] - In selectItems, how to synchronize objectId for selected val

jboss-Nth-Fan do-not-reply at jboss.com
Mon Dec 18 00:00:00 EST 2006


I'm using SelectItems approach from http://wiki.jboss.org/wiki/Wiki.jsp?page=SelectItems

The problem: when displaying a form with pre-existing selected values, the objectsId in the list of SelectItems will be different than the forms parent object that holds the reference to the selected object.

Therefore the hashes don't match in this code (ReferenceConverter  class)


  | 	int hash = Integer.valueOf(str).intValue(); 
  | 	for (Object val : values) {
  | 		if ( val!=null && val.hashCode()==hash ) {
  | 			return val;
  | 		}
  | 	}
  | 

As I feel this problem is conceptual, not sure how to synchronize the objectId for the selected value and the one value in the list of Select Items?

Please let me know if you have any suggestions,  how to tackle this one.
Thanks for your help

Yeyo

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

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



More information about the jboss-user mailing list