我试图将一个复选框绑定到我的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; }
}
速度标记:
#springBind("command")
#springFormCheckBox("command.selectedEntities", "")
这并不在所有的工作,只是输出代码一字不差。
尝试使用标准项目:
<input type="checkbox"
#if ($command.selectedEntities.contains($item)) checked="checked" #end
value="$item.key" />
每当我检查所有的箱子并提交表单,我支持bean列表保持为空。我怎样才能将设置值完成到列表中?
注:我也尝试在POJO如下:
private List <Key> selectedEntities = new AutoPopulatingList <Key>(Key.class);
环境:春天3.0.5,极速引擎1.7
我可能没有正确解释这一点,但我有一个对象显示给用户的列表。我有一个我想要显示给用户的复选框(每行) - 我需要知道他们检查了哪些行,以便当他们提交表单时,我可以采取适当的行动。问题是我无法让他们进入项目列表。 – Scott 2011-03-05 22:54:52