Digging into the RadioRenderer
source code I've noticed the following thing:
The method
@Override
protected void renderOption(FacesContext context,
UIComponent component,
Converter converter,
SelectItem curItem,
Object currentSelections,
Object[] submittedValues,
boolean alignVertical,
int itemNumber,
OptionComponentInfo optionInfo) throws IOException
overriden in the RadioRenderer
class is being called from the standard public void encodeEnd(FacesContext context, UIComponent component)
Renderer method. But there was the following piece of code:
Iterator<SelectItem> items =
RenderKitUtils.getSelectItems(context, component);
//some code
while (items.hasNext()) {
SelectItem curItem = items.next();
idx++;
// If we come across a group of options, render them as a nested
// table.
if (curItem instanceof SelectItemGroup) {
// do some
else {
// do another
}
}
So, I tried it by the example:
<h:selectOneRadio>
<f:selectItem />
<f:selectItems value="#{myBean.vals}" />
<f:selectItems value="#{myBean.valss}" />
</h:selectOneRadio>
and the selectItem
and the selectItems
es were treated as not the instances of the SelectItemGroup
. For selectItem
that's perfectly clear, but I expected that selectItems
would be mapped to the SelectItemGroup
instance.
Couldn't you clarify the thing a bit?