Usted debe ser capaz de recorrer el conjunto de claves de esta manera:
<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>
archivo de clase:
@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);
}
no he recopilado esta, pero debería ayudarte a comenzar.
Muchas gracias! Eso es exactamente lo que estaba buscando. Tuve que agregar un método. public String getLabelValue() { \t return this.getMyMap(). Get (this.currentKey); } y cambie para mostrar los valores de mi HashMap y pasar las teclas a la página siguiente. Muchas gracias ... – Sfairas