myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Problem with t:selectItems
Date Wed, 14 Mar 2007 18:02:00 GMT
Typically, I'd use "Group" as the itemValue.  However, you probably
need to have a Group converter registered by Class (or specified
explicitly in your page code).

Contrary to what Gerald stated, I don't think there's any requirement
that itemValue must be unique.

On 3/14/07, Wiebke Henrici <whenrici@cebenetwork.com> wrote:
> Hi,
>
> I want to use t:selectItems within a t:selectManyCheckbox. My problem is
> that I always get a validation error saying that the value is not valid.
>
> My JSP:
> <t:selectManyCheckbox id="sensor_access"
> value="#{sensorBacker.selectedItems}" layout="pageDirection"
> layoutWidth="3">
> <t:selectItems value="#{sensorBacker.groups}" var="Group"
> itemLabel="#{Group.name}" itemValue="#{Group.id}" />
> </t:selectManyCheckbox>
>
> The definition of sensorBacker.selectedItems and sensorBacker.groups:
> private Collection<GroupBean> groups;
> private ArrayList<GroupBean> selectedItems = new ArrayList<GroupBean>();
>
> When I load my JSP, I fill groups with:
> groups = remoteReader.readAllGroups();
> This works alright, there is one checkbox per group.
>
> I am not really sure what to use as itemValue in the t:selectItems. I
> tried with "Group", this didn't work either and gave the same error.
> I tried with Group.name, this gave no validation error but a
> ClassCastException in my backing when I tried to do a loop like that:
>
> for (GroupBean group: selectedItems){
> (some debugging output here)
> }
>
> Can anyone tell me what kind of value has to be there for itemValue? Or
> what else am I doing wrong?
>
> Wiebke
>

Mime
View raw message