Yeah, I agree with you there.
I don't know if this behavior is to spec or not.


On Thu, 13 Jan 2005 13:02:39 -0800, Korhonen, Kalle <[EMAIL PROTECTED]> wrote:
> Ok, that's the difference then.. In many cases we use a simple value
> binding in the parent object itself, i.e.:
> <h:selectOneRadio value="#{bean.integerProperty}">
>        <f:selectItem itemValue="1" itemLabel="choice 1"/>
>        <f:selectItem itemValue="2" itemLabel="choice 2"/>
> </h:selectOneRadio>
> 
> Which doesn't work (doesn't display the initial value), but updates the
> back end when you choose a value. Makes some sense why it doesn't work..
> But I think it should try to convert those itemValues to the expected
> type.
> 
> And yes, I think binding to a list of SelectItems works just fine with
> any data type.
> 
> Kalle
> 
> > -----Original Message-----
> > From: Heath Borders [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, January 13, 2005 12:21 PM
> > To: MyFaces Discussion
> > Subject: Re: selectItem support for other types of value than String
> > (was: RE: 1.0.8: first try, first problem: update)
> >
> > Its been working for us since 1.0.6.
> >
> > We use a proprietary Object, but we've also done it with Booleans.
> > We always bind to a single <f:selectItem /> tag with a List of
> > SelectItem objects.  Those objects contain our values.  We do this no
> > matter what type we are using.
> >
> >
> > On Thu, 13 Jan 2005 12:17:51 -0800, Korhonen, Kalle
> > <[EMAIL PROTECTED]> wrote:
> > > Ok, you got me interested.. What data types and components are you
> > > using, can you give me a simple example? I'm sure that for us,
> > > selectOneRadio with either Integer, int, Boolean or boolean value
> > > types don't initialize correctly with the selected value. I'm using
> > > almost the latest codebase. I wonder what could make the
> > difference if
> > > those cases work for you.
> > >
> > > Kalle
> > >
> > > > -----Original Message-----
> > > > From: Heath Borders [mailto:[EMAIL PROTECTED]
> > > > Sent: Thursday, January 13, 2005 11:27 AM
> > > > To: MyFaces Discussion; Sean Schofield
> > > > Subject: Re: selectItem support for other types of value
> > than String
> > > > (was: RE: 1.0.8: first try, first problem: update)
> > > >
> > > > I've not noticed any problems and we're using SelectItems with
> > > > non-String values all over the place.
> > > >
> > > >
> > > > On Thu, 13 Jan 2005 14:14:39 -0500, Sean Schofield
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Sounds similar to MYFACES-72 (in Jira).
> > > > >
> > > > >
> > > > > On Thu, 13 Jan 2005 09:43:18 -0800, Korhonen, Kalle
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > > > -----Original Message-----
> > > > > > > From: Francesco Consumi
> > > > [mailto:[EMAIL PROTECTED]
> > > > > > > Subject: 1.0.8: first try, first problem: update Scrive
> > > > Francesco
> > > > > > > Consumi <[EMAIL PROTECTED]>:
> > > > > > > > I'm porting an intranet app from 1.0.7 to 1.0.8.
> > > > > > > > I've got a problem with SelectOneMenu. Here is the code:
> > > > > > > >    <h:selectOneMenu id="cmbOre"
> > > > > > > value="#{mb.prenots.currentRow.ID_ORA}">
> > > > > > > >       <f:selectItems id="cmbOreI" value="#{mb.arrOre}"/>
> > > > > > > >    </h:selectOneMenu>
> > > > > > > > "arrOre" is an arrayList of SelectItems, filled by a
> > > > > > > > function with
> > > > > > > I've noticed that the selectOneMenu works well if the
> > > > underlying
> > > > > > > variable is a String instead of an int. Why doesn't
> > > > work anymore
> > > > > > > with integers ?
> > > > > > >
> > > > > >
> > > > > > Yeah, selectItems derived components don't work properly with
> > > > > > any other value types than String (still a problem in
> > > > MyFaces, version
> > > > > > last updated a week ago from CVS). In most cases, the
> > problem is
> > > > > > that the visible html component isn't initialized with
> > > > the default
> > > > > > value of the value binding (if binding is returning some
> > > > other type than String).
> > > > > > Changing/setting the value works correctly though.
> > > > Anyway, I thought
> > > > > > this was a known issue, in fact I remember seeing some
> > > > bugs open on
> > > > > > that in Sourceforge, but didn't check JIRA for it. Anyone
> > > > have any
> > > > > > better insight on this?
> > > > > >
> > > > > > Kalle
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > -Heath Borders-Wing
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
> >
> > --
> > -Heath Borders-Wing
> > [EMAIL PROTECTED]
> >
> >
> 


-- 
-Heath Borders-Wing
[EMAIL PROTECTED]

Reply via email to