Thank you, but I don't really understand why I should use any converter at all? 
Why I must convert my object to anything?

-----Original Message-----
From: David Delbecq <[EMAIL PROTECTED]>
To: MyFaces Discussion <[email protected]>
Date: Mon, 17 Sep 2007 18:27:04 +0200
Subject: Re: SelectItem's constructor's "value" parameter and selectOneListBox

> 
> You must either define an implicit converter "for-class" MyObject in 
> your jsf-config.xml, or use and explicit converter in your 
> h:selectOneListBox.
> 
> In case of implicit convertion, type of #{myBackingBean.listBoxValue} 
> will be used to decide what converter to use.
> 
> Regards,
> David Delbecq
> 
> Evgeniy Karimov a &#233;crit :
> > Hi, I have some problem:
> > Say I have
> >  <h:selectOneListBox value="#{myBackingBean.listBoxValue}" ... >
> >   <f:selectItems value="#{myBackingBean.listBoxValuesList}">
> >  </h:selectOneListBox>
> >
> > Where myBackingBean.listBoxValue is of type MyObject.
> >
> > And myBackingBean.listBoxValuesList is ArrayList<SelectItem>, which items 
> > are constructed as:
> >  new SelectItem(myObj, myObj.getDescription(), myObj.getDescription()), 
> > where myObj is type of MyObject.
> >
> > Everything looks fine, but I get an exception with some message like: 
> > "Value is no String ... does not have a Converter". Seems like 
> > myBackingBean.listBoxValue must be of String type, but this isn't logical 
> > because first argument of SelectItem constructor is of Object type, so it 
> > _should_ be possible to use MyObject as a value of ListBox, isn't it?
> >
> >      Thanks in advance.
> >   
> 

Reply via email to