beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Olander <>
Subject Re: "dynamic" datasource
Date Fri, 04 Feb 2005 02:12:40 GMT
I'm not sure exactly what you want to do here.  The <netui:checkbox>
is not legal inside a <netui:checkboxGroup>.

It turns out there is a bug  the implementation which prevents
iteration over a HashMap when the HashMap is used as the
optionsDataSource in a <netui:checkBoxGroup>.  I've entered Jira bug
242 to address this problem.

I assume what you are trying to do is something like this:

<netui:checkbox dataSource="[${key}]" />

This is not legal today.  Eddie and I looked at this and it turns out
that it is legal in JSP 2.0 EL to do something like this


which will use the "key" stored in the pageContext as the key for the
"map" stored in the pageContext.   Eddie can provide additional
details on this.  We are trying to decide if we should support this or
not for dataSources.

So at the moment this is not legal.

There is one other thing that you could do using a <netui:checkBoxGroup>

<netui:checkBoxGroup dataSource="{actionForm.checkValue}" />
   <netui:checkBoxOption value="${[pageFlow.key]}" />

should work.  It works because the value is just a standard JSP 2.0 EL
expression.  It doesn't do what you want because the value is not
stored back into the map.  Instead it would be stored as a String into
the checkValue property.

If you just want to create a checkbox group that contains all of the
elements inside a HashMap, once we fix 242 you should be able to do
that with a repeating checkBoxGroup.  It should be possible using JSTL
to filter the repeated items to display a subset of the items.  I'll
post a follow up example of that when I fix the bug.  I'll try to fix
it in the next couple of days.

Hope this helps.


On Thu, 3 Feb 2005 12:01:23 -0200, Vanessa Monteiro
<> wrote:
> Hi,
> I have a checkbox group binding to a HashMap property in my form bean. I
> need to pass the map's key dynamically but I don't know how to do that. I
> know that you can tell the form in wich key to store the data
> (<netui:checkbox datasource="['key']".../>) but how can I add
> this key value as a variable?
> Vanessa Monteiro
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.4 - Release Date: 1/2/2005

View raw message