I am trying to bind a checkbox to a list of items in my POJO.
class SimplePOJO {
private List <Key> selectedEntities = new ArrayList<Key>();
public void setSelectedEntities(List <Key> a) { this.selectedEntities = a; }
public List <Key> getSelectedEntities() { return this.selectedEntities; }
}
Speed ββMarking:
#springBind("command")
#springFormCheckBox("command.selectedEntities", "")
This does not work at all, it simply outputs the code verbatim.
Trying to use standard elements:
<input type="checkbox"
#if ($command.selectedEntities.contains($item)) checked="checked"
value="$item.key" />
Whenever I check any of the fields and submit the form, my backup bean list remains empty. How to configure the values ββin the list?
Note. I also tried doing the following in POJO:
private List <Key> selectedEntities = new AutoPopulatingList <Key>(Key.class);
Environment: Spring 3.0.5, Velocity Engine 1.7
Scott source
share