myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cagatay Civici" <cagatay.civ...@gmail.com>
Subject Re: t:selectItems still seems to need a converter
Date Wed, 10 Sep 2008 11:45:56 GMT
Conversions are the nature of jsf so it really makes sense to use a
converter for t:selectItems.

Generally the common solution is two write a generic jpa entity converter if
you are using jpa with jsf.

Using the converter-for-class kinda config once, you dont need to define the
converter each time you use it.

On Wed, Sep 10, 2008 at 7:22 AM, mjdenham <mjdenham@gmail.com> wrote:

>
> I was wondering if t:selectItems could be enhanced to work without a
> converter because it has the list of all the domain objects.
>
> My code is similar to this:
> <h:selectOneMenu value="#{order.carPart}">
>   <t:selectItems value="#{carParts}" var="part" itemValue="#{part}"
> itemLabel="#{part.name}" />
> </h:selectOneMenu>
>
> public class Order {
>   private CarPart carPart;
>   ...
> }
>
> t:selectItems automatically generates SelectItem objects for us but it
> would
> be nice if it also allowed objects to be assigned to the actual
> selectOneMenu e.g. order.carPart value without requiring a Converter.  Is
> it
> possible?
>
> I tried and get a null Converter error.
>
> Thanks
>
> Martin
> --
> View this message in context:
> http://www.nabble.com/t%3AselectItems-still-seems-to-need-a-converter-tp19411254p19411254.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message