@Test public final void testDoEncodeChildren() throws IOException { HtmlPage page = environment.getPage("/extendedDataTableTest.jsf"); HtmlElement table = (HtmlElement) 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']"); DomElement frozenHeader = page.getElementById("table:frozenHeader"); DomElement normalHeader = page.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()); DomElement body = page.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"); DomElement normalFooter = page.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()); }
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); }
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); } }
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); }  }
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); }
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);  }