You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Mike Kienenberger <mk...@gmail.com> on 2007/03/15 16:59:28 UTC

Re: SelectBox example not working 'Validation Error "Doors": Value is not a valid option."

Yes.

            <h:selectOneMenu id="doors" value="#{carconf.doors}">
                    <f:selectItem itemValue="2" itemLabel="2" />
                    <f:selectItem itemValue="4" itemLabel="4" />
                    <f:selectItem itemValue="7" itemLabel="7" />
            </h:selectOneMenu>


    public void setDoors(int doors)
    {
        this._doors = doors;
    }

itemValue is a String.   Doors expects an int.   This probably has
been the most reported issue in the last month.    For RI compatiblity
(and adherence to the spec), we can no longer coerce itemValue types
to the backing bean types.

The easiest fix would be to change the door type to "Long" and then
use "#{2}" as the itemValue.

Another possiblity is to enhance t:selectItem to perform the
coercision as it's not limited by the spec and JSF RI requirements.

On 3/15/07, Paul Spencer <pa...@apache.org> wrote:
> Any idea why the SelectBox example always fails the door validation?
>    http://example.irian.at/example-simple-20070315/selectbox.jsf
>
> Paul Spencer
>

Re: SelectBox example not working 'Validation Error "Doors": Value is not a valid option."

Posted by Mike Kienenberger <mk...@gmail.com>.
Please go ahead and make the changes.  If possible please open an
issue on it as well.

On 3/15/07, Paul Spencer <pa...@apache.org> wrote:
> Mike,
> I like the first suggestion, change the door type to long.  Would you
> like to make the changes, or shall I?
>
>
> FYI:  I found this while verifying the examples in preparation for a
> 1.1.5 release.
>
>
> Paul Spencer
>
> Mike Kienenberger wrote:
> > Yes.
> >
> >            <h:selectOneMenu id="doors" value="#{carconf.doors}">
> >                    <f:selectItem itemValue="2" itemLabel="2" />
> >                    <f:selectItem itemValue="4" itemLabel="4" />
> >                    <f:selectItem itemValue="7" itemLabel="7" />
> >            </h:selectOneMenu>
> >
> >
> >    public void setDoors(int doors)
> >    {
> >        this._doors = doors;
> >    }
> >
> > itemValue is a String.   Doors expects an int.   This probably has
> > been the most reported issue in the last month.    For RI compatiblity
> > (and adherence to the spec), we can no longer coerce itemValue types
> > to the backing bean types.
> >
> > The easiest fix would be to change the door type to "Long" and then
> > use "#{2}" as the itemValue.
> >
> > Another possiblity is to enhance t:selectItem to perform the
> > coercision as it's not limited by the spec and JSF RI requirements.
> >
> > On 3/15/07, Paul Spencer <pa...@apache.org> wrote:
> >> Any idea why the SelectBox example always fails the door validation?
> >>    http://example.irian.at/example-simple-20070315/selectbox.jsf
> >>
> >> Paul Spencer
> >>
> >
>
>
>

Re: SelectBox example not working 'Validation Error "Doors": Value is not a valid option."

Posted by Paul Spencer <pa...@apache.org>.
Mike,
I like the first suggestion, change the door type to long.  Would you
like to make the changes, or shall I?


FYI:  I found this while verifying the examples in preparation for a
1.1.5 release.


Paul Spencer

Mike Kienenberger wrote:
> Yes.
> 
>            <h:selectOneMenu id="doors" value="#{carconf.doors}">
>                    <f:selectItem itemValue="2" itemLabel="2" />
>                    <f:selectItem itemValue="4" itemLabel="4" />
>                    <f:selectItem itemValue="7" itemLabel="7" />
>            </h:selectOneMenu>
> 
> 
>    public void setDoors(int doors)
>    {
>        this._doors = doors;
>    }
> 
> itemValue is a String.   Doors expects an int.   This probably has
> been the most reported issue in the last month.    For RI compatiblity
> (and adherence to the spec), we can no longer coerce itemValue types
> to the backing bean types.
> 
> The easiest fix would be to change the door type to "Long" and then
> use "#{2}" as the itemValue.
> 
> Another possiblity is to enhance t:selectItem to perform the
> coercision as it's not limited by the spec and JSF RI requirements.
> 
> On 3/15/07, Paul Spencer <pa...@apache.org> wrote:
>> Any idea why the SelectBox example always fails the door validation?
>>    http://example.irian.at/example-simple-20070315/selectbox.jsf
>>
>> Paul Spencer
>>
> 



Re: SelectBox example not working 'Validation Error "Doors": Value is not a valid option."

Posted by Paul Spencer <pa...@mindspring.com>.
Mike,
I like the first suggestion, change the door type to long.  Would you 
like to make the changes, or shall I?


FYI:  I found this while verifying the examples in preparation for a 
1.1.5 release.


Paul Spencer

Mike Kienenberger wrote:
> Yes.
> 
>            <h:selectOneMenu id="doors" value="#{carconf.doors}">
>                    <f:selectItem itemValue="2" itemLabel="2" />
>                    <f:selectItem itemValue="4" itemLabel="4" />
>                    <f:selectItem itemValue="7" itemLabel="7" />
>            </h:selectOneMenu>
> 
> 
>    public void setDoors(int doors)
>    {
>        this._doors = doors;
>    }
> 
> itemValue is a String.   Doors expects an int.   This probably has
> been the most reported issue in the last month.    For RI compatiblity
> (and adherence to the spec), we can no longer coerce itemValue types
> to the backing bean types.
> 
> The easiest fix would be to change the door type to "Long" and then
> use "#{2}" as the itemValue.
> 
> Another possiblity is to enhance t:selectItem to perform the
> coercision as it's not limited by the spec and JSF RI requirements.
> 
> On 3/15/07, Paul Spencer <pa...@apache.org> wrote:
>> Any idea why the SelectBox example always fails the door validation?
>>    http://example.irian.at/example-simple-20070315/selectbox.jsf
>>
>> Paul Spencer
>>
>