You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Scott Fauerbach <sc...@arondight.com> on 2007/05/22 08:08:53 UTC

h:selectOneMenu bean properties not set in core 1.1.5, worked in 1.1.4

I upgraded from MyFaces Core/Impl 1.1.4 to 1.1.5 and the property setter 
never gets called even though the form is submitted (I have a phase listener 
that was called plus you could tell the browser makes a request). I went 
back to the 1.1.4 and it worked fine. I'm using the standard selectOneMenu 
component, not a tomahawk component.

JSF:
<h:form>
  <h:selectOneMenu value="#{MyBean.myProp}" onchange="submit();">
    <f:selectItem itemLabel="Zero" itemValue="0"/>
    <f:selectItem itemLabel="One" itemValue="1"/>
    <f:selectItem itemLabel="Two" itemValue="2"/>
    <f:selectItem itemLabel="Three" itemValue="3"/>
  </h:selectOneMenu>
</h:form>

Managed Bean snippet:

public void setMyProp(Long myProp) {
  this.myProp = myProp;
}

Any ideas?

Scott Fauerbach 


Re: h:selectOneMenu bean properties not set in core 1.1.5, worked in 1.1.4

Posted by Andrew Robinson <an...@gmail.com>.
Here is an enhancement bug with the code:

https://issues.apache.org/jira/browse/TOMAHAWK-1008

On 5/23/07, Andrew Robinson <an...@gmail.com> wrote:
> Please check the MyFaces WIKI FAQ for more information on this
> http://wiki.apache.org/myfaces/FAQ
>
> Look for the question:
> Select Items stop working in MyFaces 1.1.5
>
> -Andrew
>
> On 5/23/07, Andrew Robinson <an...@gmail.com> wrote:
> > That is invalid code for the JSF specification (MyFaces <= 1.1.4 was
> > not JSF compliant in that respect).
> >
> > Your item values are strings ("0", "1") not Long instances. You have
> > to either (1) use string in your backing bean, (2) use EL in the
> > itemValue to force the instantiation of numbers (though it would
> > probably create Integer not Long) or (3) write a custom select one
> > menu that has 1.1.4 behavior (search the mailing lists, I posted code
> > for that -- maybe I'll add it to the WIKI as this is definitely a FAQ)
> >
> > -Andrew
> >
> > On 5/22/07, Scott Fauerbach <sc...@arondight.com> wrote:
> > > I upgraded from MyFaces Core/Impl 1.1.4 to 1.1.5 and the property setter
> > > never gets called even though the form is submitted (I have a phase listener
> > > that was called plus you could tell the browser makes a request). I went
> > > back to the 1.1.4 and it worked fine. I'm using the standard selectOneMenu
> > > component, not a tomahawk component.
> > >
> > > JSF:
> > > <h:form>
> > >   <h:selectOneMenu value="#{MyBean.myProp}" onchange="submit();">
> > >     <f:selectItem itemLabel="Zero" itemValue="0"/>
> > >     <f:selectItem itemLabel="One" itemValue="1"/>
> > >     <f:selectItem itemLabel="Two" itemValue="2"/>
> > >     <f:selectItem itemLabel="Three" itemValue="3"/>
> > >   </h:selectOneMenu>
> > > </h:form>
> > >
> > > Managed Bean snippet:
> > >
> > > public void setMyProp(Long myProp) {
> > >   this.myProp = myProp;
> > > }
> > >
> > > Any ideas?
> > >
> > > Scott Fauerbach
> > >
> > >
> >
>

Re: h:selectOneMenu bean properties not set in core 1.1.5, worked in 1.1.4

Posted by Andrew Robinson <an...@gmail.com>.
Please check the MyFaces WIKI FAQ for more information on this
http://wiki.apache.org/myfaces/FAQ

Look for the question:
Select Items stop working in MyFaces 1.1.5

-Andrew

On 5/23/07, Andrew Robinson <an...@gmail.com> wrote:
> That is invalid code for the JSF specification (MyFaces <= 1.1.4 was
> not JSF compliant in that respect).
>
> Your item values are strings ("0", "1") not Long instances. You have
> to either (1) use string in your backing bean, (2) use EL in the
> itemValue to force the instantiation of numbers (though it would
> probably create Integer not Long) or (3) write a custom select one
> menu that has 1.1.4 behavior (search the mailing lists, I posted code
> for that -- maybe I'll add it to the WIKI as this is definitely a FAQ)
>
> -Andrew
>
> On 5/22/07, Scott Fauerbach <sc...@arondight.com> wrote:
> > I upgraded from MyFaces Core/Impl 1.1.4 to 1.1.5 and the property setter
> > never gets called even though the form is submitted (I have a phase listener
> > that was called plus you could tell the browser makes a request). I went
> > back to the 1.1.4 and it worked fine. I'm using the standard selectOneMenu
> > component, not a tomahawk component.
> >
> > JSF:
> > <h:form>
> >   <h:selectOneMenu value="#{MyBean.myProp}" onchange="submit();">
> >     <f:selectItem itemLabel="Zero" itemValue="0"/>
> >     <f:selectItem itemLabel="One" itemValue="1"/>
> >     <f:selectItem itemLabel="Two" itemValue="2"/>
> >     <f:selectItem itemLabel="Three" itemValue="3"/>
> >   </h:selectOneMenu>
> > </h:form>
> >
> > Managed Bean snippet:
> >
> > public void setMyProp(Long myProp) {
> >   this.myProp = myProp;
> > }
> >
> > Any ideas?
> >
> > Scott Fauerbach
> >
> >
>

Re: h:selectOneMenu bean properties not set in core 1.1.5, worked in 1.1.4

Posted by Andrew Robinson <an...@gmail.com>.
That is invalid code for the JSF specification (MyFaces <= 1.1.4 was
not JSF compliant in that respect).

Your item values are strings ("0", "1") not Long instances. You have
to either (1) use string in your backing bean, (2) use EL in the
itemValue to force the instantiation of numbers (though it would
probably create Integer not Long) or (3) write a custom select one
menu that has 1.1.4 behavior (search the mailing lists, I posted code
for that -- maybe I'll add it to the WIKI as this is definitely a FAQ)

-Andrew

On 5/22/07, Scott Fauerbach <sc...@arondight.com> wrote:
> I upgraded from MyFaces Core/Impl 1.1.4 to 1.1.5 and the property setter
> never gets called even though the form is submitted (I have a phase listener
> that was called plus you could tell the browser makes a request). I went
> back to the 1.1.4 and it worked fine. I'm using the standard selectOneMenu
> component, not a tomahawk component.
>
> JSF:
> <h:form>
>   <h:selectOneMenu value="#{MyBean.myProp}" onchange="submit();">
>     <f:selectItem itemLabel="Zero" itemValue="0"/>
>     <f:selectItem itemLabel="One" itemValue="1"/>
>     <f:selectItem itemLabel="Two" itemValue="2"/>
>     <f:selectItem itemLabel="Three" itemValue="3"/>
>   </h:selectOneMenu>
> </h:form>
>
> Managed Bean snippet:
>
> public void setMyProp(Long myProp) {
>   this.myProp = myProp;
> }
>
> Any ideas?
>
> Scott Fauerbach
>
>