in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ColumnGroupRenderer.java [598:730]
protected void renderSortOrderSymbol(
FacesContext context,
RenderingContext rc,
UIComponent column,
TableRenderingContext tContext,
int sortability,
Icon icon,
String sortOnclick
) throws IOException
{
if ((icon == null) || icon.isNull())
return;
ResponseWriter writer = context.getResponseWriter();
boolean supportNav = supportsNavigation(rc);
boolean NonJavaScriptBrowser = false;
boolean renderedInput = false;
if (supportNav)
{
if (isPDA(rc))
writer.writeText(XhtmlConstants.NBSP_STRING, null);
NonJavaScriptBrowser = !supportsScripting(rc);
if (NonJavaScriptBrowser)
{
renderedInput = true;
writer.startElement("input", null);
writer.writeAttribute("type", "submit", null);
String source = tContext.getTableId();
FacesBean bean = getFacesBean(column);
String value = getSortProperty(column, bean);
String state = findSortState(sortability, column, bean);
String nameAttri;
if (state != "")
{
nameAttri = XhtmlUtils.getEncodedParameter
(XhtmlConstants.SOURCE_PARAM)
+ XhtmlUtils.getEncodedParameter(source)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.VALUE_PARAM)
+ XhtmlUtils.getEncodedParameter(value)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.EVENT_PARAM)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.SORT_EVENT)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.STATE_PARAM)
+ state;
}
else
{
nameAttri = XhtmlUtils.getEncodedParameter
(XhtmlConstants.SOURCE_PARAM)
+ XhtmlUtils.getEncodedParameter(source)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.EVENT_PARAM)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.SORT_EVENT)
+ XhtmlUtils.getEncodedParameter
(XhtmlConstants.VALUE_PARAM)
+ value;
}
writer.writeAttribute("name", nameAttri, null);
if (state.equals(XhtmlConstants.SORTABLE_ASCENDING))
{
writer.writeAttribute("value",
XhtmlConstants.NON_JS_DESC_ICON, null);
}
else
{
writer.writeAttribute("value",
XhtmlConstants.NON_JS_ASC_ICON, null);
}
writer.writeAttribute("class",
SkinSelectors.SORTABLE_HEADER_SORT_ICON_STYLE_CLASS, null);
}
else
{
writer.startElement("a", null);
writer.writeURIAttribute("href", "#", null);
writer.writeAttribute("onclick", sortOnclick, null);
}
}
String altTextKey = null;
if (sortability == SORT_ASCENDING)
{
altTextKey = "af_column.SORTED_ASCEND_TIP";
}
else if (sortability == SORT_DESCENDING)
{
altTextKey = "af_column.SORTED_DESCEND_TIP";
}
else if (sortability == SORT_SORTABLE)
{
altTextKey = "af_column.SORTED_SORTABLE_TIP";
}
String altText = rc.getTranslatedString(altTextKey);
Object align = OutputUtils.getMiddleIconAlignment(rc);
//Don't render any child element for input element
if (!renderedInput)
{
// Render the icon, specifying embedded=true. This
// allows text-based Icons to render their style class
// and altText directly on the anchor itself
OutputUtils.renderIcon(context,
rc,
icon,
altText,
align,
true);
}
if (supportNav)
{
if(NonJavaScriptBrowser)
{
writer.writeAttribute("title", altText, null);
writer.endElement("input");
}
else
{
writer.endElement("a");
}
}
}