eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
166 stars 112 forks source link

h:selectOneRadio doesn't render the value of styleClass when the group attribute is specified #5507

Closed eproffit2 closed 2 months ago

eproffit2 commented 2 months ago

As stated in the [vdldoc ] :

If the "group" attribute is specified, render as follows. If the "styleClass" attribute is specified, render the value of the "styleClass" attribute as the value of the "class" attribute on the "input" element.

As of version 4.0.7, the styleClass isn't rendered. There is the same problem for the style attribute. There is the same issue with the "style" attribute.

To Reproduce : Create a page with 2 simple selectOneRadio as bellow :

<h:selectOneRadio id="radio1" group="myGroup" value="#{flash.toto}" styleClass="myClass1">
    <f:selectItem itemValue="1" itemLabel="Label 1"/>
</h:selectOneRadio>
<h:selectOneRadio id="radio2" group="myGroup" value="#{flash.toto}" styleClass="myClass2">
    <f:selectItem itemValue="2" itemLabel="Label 2"/>
</h:selectOneRadio>

The input elements rendered are without the class attribute (which should be the value of styleClass).

Expected behavior :

<input type="radio" name="myform:myGroup" id="radio1" value="radio1:1" class="myClass1"><label for="radio1"> Label 1</label>
<input type="radio" name="myform:myGroup" id="radio2" value="radio2:2" class="myClass2"><label for="radio2"> Label 2</label>
BalusC commented 2 months ago

Fixed. Thank you very much for reporting!