Skip to content

Commit

Permalink
Fix radioButton checked rendering
Browse files Browse the repository at this point in the history
The comparison for the checked attribute was not working, if the f:selectItem form is used and the values are not string values. In that case the values is compared as string to the object value, that wasn't equal.
  • Loading branch information
sebsoftware authored and stephanrauh committed Aug 7, 2020
1 parent 7e104ce commit 9094cb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void processEvent(ComponentSystemEvent event) throws AbortProcessingExcep
}
}

public String getFamily() {
public String getFamily() {
return COMPONENT_FAMILY;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
// traditional JSF approach using f:selectItem[s]
int counter=0;
for (SelectItemAndComponent option:options) {
String o = null;
if (null != option.getSelectItem().getValue()) {
o = String.valueOf(option.getSelectItem().getValue());
}
generateASingleRadioButton(context, component, radiobutton, rw, propertyName, beanValue,
option.getSelectItem().getValue(),
o,
option.getSelectItem().getLabel(), clientId+(counter++), option.getSelectItem().isDisabled());

}
Expand Down

0 comments on commit 9094cb6

Please sign in to comment.