ExtendedDataTableRenderer extends SelectionRenderer implements MetaComponentRenderer { protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { UIDataTableBase table = (UIDataTableBase) component; Object key = table.getRowKey(); table.captureOrigValue(context); table.setRowKey(context, null); RendererState state = createRowHolder(context, table, null); encodeStyle(state); encodeHeader(state); encodeBody(state); encodeFooter(state); table.setRowKey(context, key); table.restoreOrigValue(context); }  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 testDoEncodeChildren() throws IOException { HtmlPage page = environment.getPage("/extendedDataTableTest.jsf"); HtmlElement table = page.getElementById("table"); String text = table.getElementsByTagName("style").get(0).getTextContent(); assertTrue(text.contains(".rf-edt-cnt")); assertTrue(text.contains("rf-edt-c")); HtmlElement header = table.getFirstByXPath("div[@class='rf-edt-hdr']"); HtmlElement frozenHeader = header.getElementById("table:frozenHeader"); HtmlElement normalHeader = header.getElementById("table:header"); assertTrue(normalHeader.getAttribute("class").contains("rf-edt-cnt")); assertNotNull(frozenHeader.getFirstByXPath("descendant::*[@class='rf-edt-rsz']")); assertNotNull(normalHeader.getFirstByXPath("descendant::*[@class='rf-edt-rsz']")); assertEquals("headerColumnFacet1", ((HtmlElement) frozenHeader.getFirstByXPath(" .getTextContent()); assertEquals("headerColumnFacet2", ((HtmlElement) normalHeader.getFirstByXPath(" .getTextContent()); HtmlElement body = table.getElementById("table:b"); assertEquals("rf-edt-b", body.getAttribute("class")); assertNotNull(body.getFirstByXPath("descendant::*[@class='rf-edt-spcr']")); assertNotNull(body.getFirstByXPath("descendant::*[@class='rf-edt-cnt'] assertEquals("noDataFacet", ((HtmlElement) page.getFirstByXPath(" .getTextContent()); HtmlElement footer = table.getFirstByXPath("div[@class='rf-edt-ftr']"); HtmlElement frozenFooter = footer.getFirstByXPath("descendant::*[@class='rf-edt-ftr-fzn']/div"); HtmlElement normalFooter = footer.getElementById("table:footer"); assertTrue(normalFooter.getAttribute("class").contains("rf-edt-ftr-cnt")); assertEquals("footerColumnFacet1", ((HtmlElement) frozenFooter .getFirstByXPath("descendant::*[@class='rf-edt-ftr-c-cnt'] .getTextContent()); assertEquals("footerColumnFacet2", ((HtmlElement) normalFooter .getFirstByXPath("descendant::*[@class='rf-edt-ftr-c-cnt'] .getTextContent()); }