myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: type problems with t:selectOneMenu / f:selectItem
Date Tue, 24 Jul 2007 19:59:42 GMT
item value must be the exact same type as the backing bean
getter/setter. A converter will not help!

In your example, itemValue is a string (use EL to use other types), so
therefore getYear/setYear must be a string as well for it to work.

This was broken in myfaces 1.1.4.

Please see the WIKI as it is documented there.

On 7/24/07, Marcus Beyer <mb@thomas-daily.de> wrote:
>
> Greetings!
>
> I am currently trying to switch from MyFaces 1.1.4 + Tomahawk 1.1.3
> to MyFaces 1.1.5 + Tomahawk 1.1.6.
>
> My Problem is this piece of code which used to work before the switch:
>
> <t:selectOneMenu value="#
> {projectSearchHandler.projectSearchValue.year}">
>         <f:selectItem itemLabel="2007" itemValue="2007" />
>         <f:selectItem itemLabel="2008" itemValue="2008" />
>         <f:selectItem itemLabel="2009" itemValue="2009" />
> </t:selectOneMenu>
>
> with ProjectSearchValue.setYear() looking like this:
>
>     public void setYear( java.lang.Integer year );
>
> The setter is not called on form submit and I see no error message :(
>
> The following questions are currently torturing me:
>
> 1. Is it possible to increase the verbosity so that I can see *that*
> or even *why* the setter is not called?
>
> 2. Why did the code work and does not work anymore?
>
> 3. The setter is called if the setter parameter is a String. However
> I really
> don't want to change the parameter type. What can I do to make this
> work?
> Do I have to apply a converter or something? How? I tried but did not
> succeed.
>
> 4. Does MyFaces + Tomahawk 1.2 make a difference in this regard?
>
> Lots of thanks in advance!
>
> Marcus
>
>

Mime
View raw message