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 <[EMAIL PROTECTED]> 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