JSF: attach rich:toggleControl to radio buttons or select items.
- by arw
Has anyone had any success attaching a rich:toggleControl component to a radio button component (h:selectOneRadio) or alternatively any of its children select items (in this case s:enumItem).
Basic code example:
<h:selectOneRadio value="#{backingValue}">
<s:enumItem enumValue="VAL_1" itemLabel="Value One" />
<s:enumItem enumValue="VAL_2" itemLabel="Value Two" />
<s:convertEnum />
</h:selectOneRadio>
The ideal thing would be to attach the toggle control to the enumItems so I could have it switch to a particular state. However at this point I'd be happy if the toggle control can just be attached to the selectOneRadio. I've tried the toggle control as a child of the selectOneRadio and enumItems; neither works. I've also tried wrapping the toggleControl around the selectOneRadio, the toggle control works in this case but the radio buttons don't :(