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: Question about creating a dropdown list with dynamic values
Date Tue, 31 Oct 2006 15:34:13 GMT
If you use JBoss-Seam, there is an annotation that you use a normal
list (not of select items) to build a drop down [1]

[1] http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamSelectItems

On 10/31/06, Ernst Fastl <ernst.fastl@gmail.com> wrote:
> You could write a method:
>
> List<SelectItem> retval = new ArrayList<SelectItem>();
>
> for(A a:list)
>   retval.add(new SelectItem(a.getAttr1() + a.getAttr2() ) )
>
> return retval;
>
> and use this as value for a selecItems-component
>
> hope that helps
>
> Ernst
>
> On 10/31/06, ying lcs <yinglcs@gmail.com> wrote:
> > i have a list of object , A. And object A has 2 string attributes: attr1, attr2.
> >
> > How can i create a dropdown select list by combining the string of
> > attr1 and string of attr2?
> >
> > i.e. I want to create a select value option of
> > [attr1, attr2]  // for each A in the list of A.
> >
> > Thank you for any help.
> >
>

Mime
View raw message