-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Normal
-
Affects Version/s: 6.5.3
-
Component/s: Databind
-
Environment:
Irrelevant
-
None
This code is better for org.zkoss.zkplus.databind.RadiogroupSelectedItemConverter:
public Object coerceToUi(Object val, Component comp) {
if (val != null && comp instanceof Radiogroup) {
Radiogroup rg = (Radiogroup) comp;
// iterate to find the selected radio via the value
for (Iterator<Radio> it = rg.getItems().iterator(); it.hasNext() {
Radio child = it.next();
if (val.equals(((Radio) child).getValue()))
}
}
return null;
}
Feel free to add this simple snippet to ZK.