private static final Log LOG = LogFactory.getLog(SelectOneRadioRenderer.class);
public void encodeEnd(FacesContext facesContext,
UIComponent uiComponent) throws IOException {
UISelectOne component = (UISelectOne) uiComponent;
String clientId = component.getClientId(facesContext);
ComponentUtil.findPage(facesContext, component)
.getOnloadScripts().add("Tobago.selectOneRadioInit('" + clientId + "')");
if (LOG.isDebugEnabled()) {
for (Object o : component.getChildren()) {
LOG.debug("ITEMS " + o);
if (o instanceof UISelectItems) {
UISelectItems uiitems = (UISelectItems) o;
Object v = uiitems.getValue();
LOG.debug("VALUE " + v);
if (v != null) {
LOG.debug("VALUE " + v.getClass().getName());
}
}
}
}
List<SelectItem> items = ComponentUtil.getItemsToRender(component);
boolean inline = ComponentUtil.getBooleanAttribute(component, ATTR_INLINE);
String title = HtmlRendererUtil.getTitleFromTipAndMessages(facesContext, component);
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
if (!inline) {
writer.startElement(HtmlConstants.TABLE, component);
//writer.writeComponentClass();
writer.writeAttribute(HtmlAttributes.BORDER, 0);
writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
writer.writeStyleAttribute();
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
}
Object value = component.getValue();
List clientIds = new ArrayList();
for (SelectItem item : items) {
if (!inline) {
writer.startElement(HtmlConstants.TR, null);