I've found a better solution. Here's what I've done:

Template:
<div jwcid="@For" source="..." value="currentItem">
  <input jwcid="@Checkbox" value="selected"/>
</div>

Specification:
<property name="currentItem"/>
<property name="selectedItems" initialValue="new java.util.HashSet()"/>

Page class:
public astract Item getCurrentItem();
public abstract Set<Item> getSelectedItems();

public boolean isSelected()
{
    return getSelectedItems().contains(getCurrentItem());
}

public void setSelected(boolean selected)
{
    if (selected)
        getSelectedItems().add(getCurrentItem());
    else
        getSelectedItems().remove(getCurrentItem());
}


And I'm set. When the page finishes rewinding, the selectedItems property will
contain a set of, duh, all all selected items. Works like a charm... I just wish
there was a more straightforward way to do this.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to