예제 #1
0
  protected String getColumnTag(UIColumn column) {
    String headerText = column.getHeaderText();
    UIComponent facet = column.getFacet("header");

    if (headerText != null) {
      return headerText.toLowerCase();
    } else if (facet != null) {
      return exportValue(FacesContext.getCurrentInstance(), facet).toLowerCase();
    } else {
      throw new FacesException("No suitable xml tag found for " + column);
    }
  }
예제 #2
0
  protected void encodeColumnHeaderContent(FacesContext context, UIColumn column, String sortIcon)
      throws IOException {
    ResponseWriter writer = context.getResponseWriter();

    UIComponent header = column.getFacet("header");
    String headerText = column.getHeaderText();

    writer.startElement("span", null);

    if (header != null) header.encodeAll(context);
    else if (headerText != null) writer.write(headerText);

    writer.endElement("span");

    if (sortIcon != null) {
      writer.startElement("span", null);
      writer.writeAttribute("class", sortIcon, null);
      writer.endElement("span");
    }
  }