public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException
{
org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, UISelectOne.class);
UISelectOne selectOne = (UISelectOne)uiComponent;
String layout = getLayout(selectOne);
boolean pageDirectionLayout = false; // Defaults to LINE_DIRECTION
if (layout != null)
{
if (layout.equals(PAGE_DIRECTION))
{
pageDirectionLayout = true;
}
else if (layout.equals(LINE_DIRECTION))
{
pageDirectionLayout = false;
}
else
{
log.severe("Wrong layout attribute for component " + selectOne.getClientId(facesContext) + ": " + layout);
}
}
ResponseWriter writer = facesContext.getResponseWriter();
Map<String, List<ClientBehavior>> behaviors = null;
if (uiComponent instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
if (!behaviors.isEmpty())
{
ResourceUtils.renderDefaultJsfJsInlineIfNecessary(facesContext, writer);
}
}
writer.startElement(HTML.TABLE_ELEM, selectOne);
HtmlRendererUtils.renderHTMLAttributes(writer, selectOne,
HTML.SELECT_TABLE_PASSTHROUGH_ATTRIBUTES);
if (behaviors != null && !behaviors.isEmpty())
{
writer.writeAttribute(HTML.ID_ATTR, selectOne.getClientId(facesContext), null);
}
else
{
HtmlRendererUtils.writeIdIfNecessary(writer, selectOne, facesContext);
}