[
https://issues.apache.org/struts/browse/WW-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47081#action_47081
]
William McAvinney commented on WW-1289:
---------------------------------------
The behavior of the <s:radio> tag in simple theme is really different. No other
Form tag I know of generates a label in simple theme, and no other tag modifies
an id specifically entered in the id parameter of the tag.
To quote from the Struts 2 documentation, "The simple theme does not inject any
default markup, and lets us add whatever special markup we want around the
tags. ... The XHTML (and AJAX) themes will automatically inject a label tag
into the form." The need is not for another tag. It is for the radio tag to
work in the simple theme as other Form tags (and as advertised).
Unfortunately this has been deployed like this for a long time, so it may be
too late to change the behavior. Can you fix it by giving us either a strict
simple theme, or at least an alternate simple template that corrects this
behavior.
Thanks, Bill
BTW You can stop the unwanted 2nd label tag from rendering by:
in JSP:
<span class="sRadio"><s:radio theme="simple" name="selectedOption"
id="choiceNo" list="#{'false':''}"/></span>
in CSS:
.sRadio label {display:none}
This is probably a little safer in keeping screen readers from noticing the 2nd
label.
Remember your label tag must have for=<id><value> (e.g. "choiceNofalse")
because the value is concatenated to the id by the simple theme.
> Radio tag like struts
> ---------------------
>
> Key: WW-1289
> URL: https://issues.apache.org/struts/browse/WW-1289
> Project: Struts 2
> Issue Type: New Feature
> Components: Plugin - Tags
> Affects Versions: WW 2.2.2, 2.0.5
> Reporter: Ricardo Lecheta
> Fix For: Future
>
>
> The radio tag from webwork is amazing and very easy to use. But sometimes you
> don't want to use a list+ognl. Generally you have to put a getList() in your
> Action.
> The html:radio tag from struts is more simple, and easy too.
> I am proposing that both tags could exists in SAF2.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.