protected void renderSortButton(FacesContext context, UIComponent column, String cssPrefix) throws IOException {
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HtmlConstants.SPAN_ELEM, column);
String classAttr = String.format("%1$s-srt %1$s-srt-btn ", cssPrefix);
SortOrder sortOrder = (SortOrder) column.getAttributes().get("sortOrder");
if (sortOrder == null || sortOrder == SortOrder.unsorted) {
classAttr = classAttr + String.format("%s-srt-uns", cssPrefix);
} else if (sortOrder == SortOrder.ascending) {
classAttr = classAttr + String.format("%s-srt-asc", cssPrefix);
} else if (sortOrder == SortOrder.descending) {