ExtendedDataTableRenderer extends SelectionRenderer implements MetaComponentRenderer { protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { String savedTableState = (String) component.getAttributes().get("tableState"); if (savedTableState != null && ! savedTableState.isEmpty()) { ExtendedDataTableState tableState = new ExtendedDataTableState(savedTableState); consumeTableState(context, (UIDataTableBase) component, tableState); } Map<String, Object> attributes = component.getAttributes(); writer.startElement(HtmlConstants.DIV_ELEM, component); writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context), null); writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rf-edt", (String) attributes.get("styleClass")), null); renderAttribute(context, HtmlConstants.STYLE_ATTRIBUTE, attributes.get("style")); }  void encodeHeader(RendererState state); void encodeBody(RendererState state); void encodeFooter(RendererState state); void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId); void decodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId); RendererState createRowHolder(FacesContext context, UIComponent component, Object[] options); void encodeRow(ResponseWriter writer, FacesContext facesContext, RowHolderBase rowHolder); void consumeTableState(FacesContext facesContext, UIDataTableBase table, ExtendedDataTableState tableState);  }
@Test public final void testDoEncodeBegin() throws IOException { HtmlPage page = environment.getPage("/extendedDataTableTest.jsf"); HtmlElement table = page.getElementById("table"); assertEquals("rf-edt", table.getAttribute("class")); assertEquals("headerFacet", table.getElementById("table:headerFacet").getTextContent()); }