Radio Buttons do not render correctly through the tag using the 'checked' attribute

Description

I am using a custom population strategy that looks only in the request first and then for values in the tag itself. I've noticed that the checked attribute does not work for radio buttons if the value is a non-primitive object.

For example, using an example Story and Category object:

Story
Long id;
Boolean approved;
Category category;

Category
Long id;
String name ;

The following tags work correctly with the checked attribute preselecting for both radio buttons and checkboxes:

<stripes:checkbox checked="${actionBean.story.approved}" name="story.approved" value="true"/>
<stripes:radio checked="${actionBean.story.approved}" name="story.approved" value="true"/>

However, using a non primitive object such as category, of the following similar tags, only the checkbox tag works correctly:

<stripes:checkbox checked="${actionBean.story.category}" name="story.category" value="${actionBean.healthCategory}"/>
<stripes:radio checked="${actionBean.story.category}" name="story.category" value="${actionBean.healthCategory}"/>

I believe the reason for this is because the checked field in the InputRadioButtonTag.class is declared as a 'String checked' field. The checked attribute in the InputCheckboxTag.class on the other hand uses an 'Object checked' field. In the InputRadioButtonTag, the checked field is stored as the toString value of the object, instead of calling the object's custom converter, so the checked value never matches the value provided in the tag.

Environment

None

Status

Assignee

Unassigned

Reporter

Anthony DePalma

Labels

Tester

None

Components

Affects versions

Release 1.5.6

Priority

Major
Configure