Hello,

Logs from JSF -RI clearly show that converter was used to convert
submitted string to an Alternative object. The error state that this
converted value is not equal to any of the available SeletItem Value.
This is obviously caused by your Alternative class not properly
implements the equals() method. As such, it falls back to
Object.equals() which only compare instances identifiers. And because
the result of your converter and the result of your getAlternative()
both return new items, equals() between them returns false.
The reason it works if your cange model is maybe that the model used
implement properly equals() or the backing framework you use (i don't
know JaxB) ensure there is only 1 instance of a given Alternative with a
give Id.

So, solution
implement the equals method.

reference:
javax.faces.component._SelectItemsUtil, method public static boolean
matchValue(Object value, Iterator selectItemsIter)

while (selectItemsIter.hasNext())
        {
            SelectItem item = (SelectItem) selectItemsIter.next();
            if (item instanceof SelectItemGroup)
            {
                /..../
            }
            else
            {
                Object itemValue = item.getValue();
                if (value==itemValue || (itemValue.equals(value)))
                {
                    return true;
                }
            }
En l'instant précis du 10/07/07 21:40, Erlend Hamnaberg s'exprimait en
ces termes:
> Matthias Wessendorf wrote:
>> are you sure
>>
>> for-class register "Alternative" is same than JaxB ?
>>
>> full qualified class name ?
> Of course fully qualified.
> The classname in question is org.evatest.xml.Alternative.
>
> The behavior doesn't change weather i use this method or explicitly
> define a converter-id.
>>
>> On 7/10/07, Erlend Hamnaberg <[EMAIL PROTECTED]> wrote:
>>> Hello.
>>>
>>> Last time i posted i didnt get much response from this questi
>>

Reply via email to