public void encodeChildren(FacesContext facesContext, UIComponent uiComponent) throws IOException { validateParameters(facesContext, uiComponent, null); DOMContext domContext = DOMContext.attachDOMContext(facesContext, uiComponent); Element root = (Element) domContext.getRootNode(); DOMContext.removeChildren(root); PanelSeries list = (PanelSeries) uiComponent; UISeries uiList = (UISeries) uiComponent; int rowIndex = uiList.getFirst(); uiList.setRowIndex(rowIndex); int numberOfRowsToDisplay = uiList.getRows(); int countOfRowsDisplayed = 0; while (uiList.isRowAvailable()) { if ((numberOfRowsToDisplay > 0) && (countOfRowsDisplayed >= numberOfRowsToDisplay)) { break; } Iterator childs; childs = list.getChildren().iterator(); while (childs.hasNext()) { UIComponent nextChild = (UIComponent) childs.next(); if (nextChild.isRendered()) { domContext.setCursorParent(root); domContext.streamWrite(facesContext, uiComponent, domContext.getRootNode(), root); encodeParentAndChildren(facesContext, nextChild); } } rowIndex++; countOfRowsDisplayed++; uiList.setRowIndex(rowIndex); } uiList.setRowIndex(-1); }
public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException { DOMContext domContext = DOMContext.attachDOMContext(facesContext, uiComponent); if (!domContext.isInitialized()) { Element rootSpan = domContext.createElement(HTML.DIV_ELEM); domContext.setRootNode(rootSpan); setRootElementId(facesContext, rootSpan, uiComponent); } Element root = (Element) domContext.getRootNode(); String style = ((PanelSeries) uiComponent).getStyle(); if (style != null && style.length() > 0) root.setAttribute(HTML.STYLE_ATTR, style); else root.removeAttribute(HTML.STYLE_ATTR); root.setAttribute(HTML.CLASS_ATTR, ((PanelSeries) uiComponent).getStyleClass()); domContext.stepInto(uiComponent); }