On Aug 7, 2005, at 9:01 AM, Marcus Brito wrote:
Hello, folks.
I have an application where I present the user with a search
result, from which
s/he will select some items, to perform an action on them. Think
about a "delete
selected" action or something like that.
So, I need to:
1) Render a table with the search results [OK]
3) Wrap the table in a form [OK]
2) Render a checkbox on each line
<span jwcid="@base:For" source="ognl:searchResults"
value="ognl:result" index="ognl:i">
...
<input type="checkbox" jwcid="@Checkbox" selected="ognl:checkboxValues
[i]" />
...
</span>
Declare i to be an int and checkboxValues to be a boolean[] in
your .page file. In pageBeginRender() do
setCheckboxValues(new boolean[searchResults.size]); and you should be
good to go. As long as searchResults is a List, you can iterate
through with an index and the corresponding checkboxValues[] element
will tell you if the item's box was checked.
Todd
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]