I have found a solution after lots of experiments.
I am still not sure what caused the problems (I tried tons of variants
in the JSP) but finally it started to work. No changes in the action
code, only in the JSP block.
It started to work after I added jstl into the game and dropped the
s:iterate tag.
<s:set name="groups" value="extensionGroups" />
<c:forEach items="${groups}" var="group">
<b>${group.desc}</b><br />
<s:checkboxlist
list="groupedExtensions['${group.treeNo}']"
listKey="name"
listValue="desc"
name="extensions"
labelposition="right"
/>
</c:forEach>
Can somebody say what caused problems in the previous code I have sent?
Why did it work on the 1st invocation and failed on all other calls?
Dariusz Wojtas
On 12/22/06, Dariusz Wojtas <[EMAIL PROTECTED]> wrote:
Hi,
I have such properties in my action:
private ArrayList<Extension> extensionGroups = null;
private HashMap<String, ArrayList<Extension>> groupedExtensions = null;
The 1st list contains only some 'Extension' elements.
The 2nd map contains other lists of extensions (values) with some
property (treeNo) from the parent used as the key.
Then I have a JSP page with such construct somewhere in it:
<s:iterator value="extensionGroups">
<b>${desc}</b><br />
<s:checkboxlist
list="groupedExtensions['${treeNo}']"
listKey="name"
listValue="desc"
name="extensions"
labelposition="right"
/>
</s:iterator>
And here is a strange thing:
When I start the app and run the action for the 1st time I get nice
result AS EXPECTED:
GROUP1
chk: extension1
chk: extension2
chk: extension3
GROUP2
chk: extension4
chk: extension5
But after reloading the page (no extra params in the url, just plain
GET), the result is:
chk: GROUP1
chk: GROUP2
Looks like the context of the data beaing displayed is different.
But it's the same page! The same code and the same data.
After restarting the app it is again the same behaviour.
My debugs in the actions (getters) show that the same data is returned
in all cases.
What am I doing wrong?
Dariusz Wojtas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]