9
A
回答
14
你应该能够循环通过按键这样的:
<form t:type="Form">
<t:Loop t:source="myMap.keySet()" t:value="currentKey">
<input type="Checkbox" t:type="Checkbox" t:id="checkbox"
t:value="currentValue"/>
<label t:type="Label" for="checkbox">${mapValue}</label>
</t:Loop>
</form>
类文件:
@Property
private Object currentKey;
@Persist
private Set<String> selection = new HashSet<String>();
public Map<String,String> getMyMap() {
...
}
public boolean getCurrentValue() {
return this.selection.contains(this.currentKey);
}
public void setCurrentValue(final boolean currentValue) {
final String mapValue = this.getMapValue();
if (currentValue) {
this.selection.add(mapValue);
} else {
this.selection.remove(mapValue);
}
}
public String getMapValue() {
return this.getMyMap().get(this.currentKey);
}
我没有编这一点,但它应该帮助你开始。
相关问题
- 1. 通过哈希映射映射,需要返回哈希映射
- 2. 通过嵌套for循环初始化哈希映射
- 3. 通过无迭代器的哈希映射循环
- 4. 迭代通过哈希映射'块'
- 5. 通过支持哈希映射查询
- 6. 如何迭代通过哈希映射映射列表元素
- 7. 循环通过阵列从哈希表
- 8. 通过Ember JS RSVP哈希循环?
- 9. Perl通过阵列哈希循环
- 10. 哈希映射内的哈希映射的平均值
- 11. 哈希映射和并发哈希映射有什么区别?
- 12. 检测循环扶养在哈希映射在Java中
- 13. 无法运行循环哈希映射的方法
- 14. 使用哈希映射
- 15. 哈希映射迭代
- 16. 排序哈希映射
- 17. 实现哈希映射
- 18. PowerShell哈希映射类型
- 19. 使用哈希映射
- 20. 哈希映射对象键
- 21. 哈希映射的成员?
- 22. 迭代哈希映射
- 23. 聚簇哈希映射
- 24. 方法从哈希映射
- 25. 映射到一个哈希
- 26. Python中的哈希映射
- 27. 我想创建一个哈希映射与内部映射和外部映射关系的哈希映射?
- 28. 从哈希映射通过变量获得密钥
- 29. 通过嵌套哈希映射进行迭代
- 30. 如何通过哈希映射数据BaseAdapter Android中
非常感谢!这正是我正在寻找的。必须添加一个方法。 public String getLabelValue(){ \t return this.getMyMap()。get(this.currentKey); } and change 为了显示我的HashMap的值并将按键传递到下一页。 非常感谢... – Sfairas 2010-03-15 16:29:59