Radio Buttons do not render correctly through the tag using the 'checked'
attribute
-----------------------------------------------------------------------------------
Key: STS-849
URL: http://www.stripesframework.org/jira/browse/STS-849
Project: Stripes
Issue Type: Bug
Components: Tag Library
Affects Versions: Release 1.5.6
Reporter: Anthony DePalma
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.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development