[jboss-user] [JBoss Seam] - Re: <si:selectItems> Value is not a valid option.

petemuir do-not-reply at jboss.com
Wed Nov 29 04:34:36 EST 2006


No, id equality is not an absolute requirement.  

Lets say you have a nationality dropdown; we'll call the objects looked up for the dropdown v1, and the the objects looked up by the entity converter v2.

In the dropdown you select British as your nationality (which is Britishv1); the EntityConverter does a lookup based on id and retrieves a new copy of the British object (Britishv2).

You need to make sure that Britishv1.equals(Britishv2) and must assume that they are looked up in different persistence contexts.

What this boils down to as a general rule is that you must compare on some unique property.

I'll take a fresh look at lifting this requirement.


is the id a primitive or an object? If its an object remember (object1 == object2) != (object1.equals(object2)

The Validation error says 'value is not a valid option' is given by myfaces if it cannot find the selected object in the original list, so yes, by this point the entity converter has looked up the correct objects, it's just they aren't equal.

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

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

More information about the jboss-user mailing list