示例#1
0
 public static void renderAttributeAndBehaviors(
     FacesContext facesContext, UIComponent component, ComponentAttribute componentAttribute)
     throws IOException {
   Object attributeValue =
       getAttributeAndBehaviorsValue(facesContext, component, componentAttribute);
   renderAttribute(facesContext, componentAttribute.getHtmlAttributeName(), attributeValue);
 }
  @Override
  protected void doEncodeChildren(
      ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException {
    AbstractDataGrid dataGrid = (AbstractDataGrid) component;
    writer.startElement(HtmlConstants.TABLE_ELEMENT, dataGrid);
    writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, dataGrid.getClientId(facesContext), null);
    Map<String, Object> attributes = dataGrid.getAttributes();
    String classes = concatClasses("rf-dg", attributes.get(HtmlConstants.STYLE_CLASS_ATTR));
    writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, classes, null);
    RenderKitUtils.renderAttribute(
        facesContext, "style", attributes.get(HtmlConstants.STYLE_ATTRIBUTE));
    RenderKitUtils.renderAttribute(
        facesContext, HtmlConstants.TITLE_ATTRIBUTE, attributes.get(HtmlConstants.TITLE_ATTRIBUTE));
    encodeCaption(writer, facesContext, dataGrid);
    encodeHeader(writer, facesContext, dataGrid, false);
    encodeFooter(writer, facesContext, dataGrid, false);
    encodeTBody(writer, facesContext, dataGrid, false);

    writer.endElement(HtmlConstants.TABLE_ELEMENT);
  }