What behaviour are you getting? It's difficult to debug the problem if
we don't know what's broken ;-)
L.
Eric Benedetti wrote:
I've got a Form which contains a LazySortedMap, the keys being Strings
and the values being LazyList objects. Each LazyList object contains a
list of Checkbox objects (basically just like LabelValueBean objects).
In the jsp, I would like to iterate through the sorted map, and for each
LazyList, iterate through that printing out the Checkbox values. I
cannot get this working ! Anyone know how I can write my jsp so that
each checkbox value is something like group(keyname).checked[index] ?
Help is much appreciated!
I've tried in the jsp something like:
<nested:iterate id="group" property="groups">
<bean:define name="group" property="key" id="thiskey"
type="java.lang.String"/>
<nested:iterate id="box" name="group" property="value"
indexId="i"> <% String cbprop = "group(" +
thiskey + ")[" + i + "].checked"; %>
<html:checkbox property="<%= cbprop %>"/>
</nested:iterate> </nested:iterate>
I've got the form defined:
protected Map groups = MapUtils.lazySortedMap(
new TreeMap(),
new Factory() {
public Object
create() {
return
buildGroup();
}
});
public Map getGroups() {
return groups;
}
public void setGroups(final TreeMap newGroups) {
groups = MapUtils.lazySortedMap(newGroups, new Factory() {
public Object create() {
return buildGroup();
}
});
}
private List buildGroup() {
List checkboxes = ListUtils.lazyList(new java.util.ArrayList(),
new Factory() {
public Object create() {
return new Checkbox();
}
});
return checkboxes;
}
public void setGroup(String key, Object value) {
getGroups().put(key,value);
}
public Object getGroup(String key) {
return getGroups().get(key);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]