// TODO : Check here for getSubmittedValue. Look at RendererUtils.getValue
// this is useless object creation
// Object itemValue = selectItem.getValue();
UISelectOne selectOne = (UISelectOne)uiComponent;
if (isSelectItemGroup) {
if (pageDirectionLayout)
writer.startElement(HTML.TR_ELEM, selectOne);
writer.startElement(HTML.TD_ELEM, selectOne);
writer.write(selectItem.getLabel());
writer.endElement(HTML.TD_ELEM);
if (pageDirectionLayout) {
writer.endElement(HTML.TR_ELEM);
writer.startElement(HTML.TR_ELEM, selectOne);
}
writer.startElement(HTML.TD_ELEM, selectOne);
writer.startElement(HTML.TABLE_ELEM, selectOne);
writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
SelectItemGroup group = (SelectItemGroup) selectItem;
SelectItem[] selectItems = group.getSelectItems();
for (int i=0; i<selectItems.length; i++) {
renderGroupOrItemRadio(facesContext, selectOne, selectItems[i], currentValue, converter, pageDirectionLayout);
}
writer.endElement(HTML.TD_ELEM);
writer.endElement(HTML.TR_ELEM);
writer.endElement(HTML.TABLE_ELEM);
writer.endElement(HTML.TD_ELEM);
if (pageDirectionLayout)
writer.endElement(HTML.TR_ELEM);
} else {
writer.write("\t\t");
if (pageDirectionLayout)
writer.startElement(HTML.TR_ELEM, selectOne);
writer.startElement(HTML.TD_ELEM, selectOne);
writer.startElement(HTML.LABEL_ELEM, selectOne);
String itemStrValue = RendererUtils.getConvertedStringValue(facesContext, selectOne, converter, selectItem.getValue());
boolean itemDisabled = selectItem.isDisabled();
boolean itemChecked = itemStrValue.equals(currentValue);
String labelClass = null;
boolean componentDisabled = isDisabled(facesContext, selectOne);
if (componentDisabled || itemDisabled) {
labelClass = (String) selectOne.getAttributes().get(JSFAttr.DISABLED_CLASS_ATTR);
} else {
labelClass = (String) selectOne.getAttributes().get(JSFAttr.ENABLED_CLASS_ATTR);
}
if (labelClass != null) {
writer.writeAttribute("class", labelClass, "labelClass");
}