private List<Integer> getBodyRows(Map<String, Object> appMap, UIData data) { List<Integer> result = null; String bodyRows = (String) data.getAttributes().get("bodyrows"); if (bodyRows != null) { String [] rows = Util.split(appMap, bodyRows, ","); if (rows != null) { result = new ArrayList<>(rows.length); for (String curRow : rows) { result.add(Integer.valueOf(curRow)); } } } return result; }
public static void add(FacesContext facesContext, DataPaginator dataPaginator) { UIData uiData = dataPaginator.findUIData(); if (uiData == null) return; dataPaginator.setUIData(uiData); if (!uiData.getAttributes().containsKey(DataPaginatorGroup.class.getName())) { uiData.getAttributes().put(DataPaginatorGroup.class.getName(), new ArrayList()); } List paginatorList = (List)uiData.getAttributes().get(DataPaginatorGroup.class.getName()); String clientId = dataPaginator.getClientId(facesContext); if (!paginatorList.contains(clientId)) { paginatorList.add(clientId); } }
private List<Integer> getBodyRows(Map<String, Object> appMap, UIData data) { List<Integer> result = null; String bodyRows = (String) data.getAttributes().get("bodyrows"); if (bodyRows != null) { String [] rows = Util.split(appMap, bodyRows, ","); if (rows != null) { result = new ArrayList<>(rows.length); for (String curRow : rows) { result.add(Integer.valueOf(curRow)); } } } return result; }
private List<Integer> getBodyRows(Map<String, Object> appMap, UIData data) { List<Integer> result = null; String bodyRows = (String) data.getAttributes().get("bodyrows"); if (bodyRows != null) { String [] rows = Util.split(appMap, bodyRows, ","); if (rows != null) { result = new ArrayList<Integer>(rows.length); for (String curRow : rows) { result.add(Integer.valueOf(curRow)); } } } return result; }
private List<Integer> getBodyRows(Map<String, Object> appMap, UIData data) { List<Integer> result = null; String bodyRows = (String) data.getAttributes().get("bodyrows"); if (bodyRows != null) { String [] rows = Util.split(appMap, bodyRows, ","); if (rows != null) { result = new ArrayList<>(rows.length); for (String curRow : rows) { result.add(Integer.valueOf(curRow)); } } } return result; }
public static void execute(UIData uiData, Invoker invoker) { if (uiData== null || !uiData.getAttributes().containsKey(DataPaginatorGroup.class.getName())) return; List dataPaginatorClientIdList = (List) uiData.getAttributes().get(DataPaginatorGroup.class.getName()); Iterator it = dataPaginatorClientIdList.iterator(); FacesContext facesContext = FacesContext.getCurrentInstance(); while (it.hasNext()) { UIComponent component = CoreComponentUtils.findComponent(UINamingContainer.getSeparatorChar(facesContext) + String.valueOf(it.next()), facesContext.getViewRoot()); if (component != null && component.isRendered() && component instanceof DataPaginator) { invoker.invoke((DataPaginator)component); } } }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
private Object getRowKey(UIData data) { Object rowKey; DataModel dataModel = (DataModel) data.getAttributes().get("dataModel"); if (data instanceof UIDataAdaptor && dataModel instanceof ExtendedDataModel) { UIDataAdaptor dataAdaptor = (UIDataAdaptor) data; rowKey = dataAdaptor.getRowKey(); } else { Object rowData = data.getRowData(); rowKey = getPrimaryKey(rowData); } return rowKey; }
/** * Renders the start of a new row of body content. * @param facesContext the <code>FacesContext</code>. * @param writer the <code>ResponseWriter</code>. * @param uiData the <code>UIData</code> being rendered. * @throws IOException if an exceptoin occurs. */ protected void renderRowStart( FacesContext facesContext, ResponseWriter writer, UIData uiData, Styles styles, int rowStyleIndex) throws IOException { writer.startElement(HTML.TR_ELEM, null); // uiData); renderRowStyle(facesContext, writer, uiData, styles, rowStyleIndex); Object rowId = uiData.getAttributes().get(org.apache.myfaces.shared.renderkit.JSFAttr.ROW_ID); if (rowId != null) { writer.writeAttribute(HTML.ID_ATTR, rowId.toString(), null); } }
/** * Renders the start of a new row of body content. * @param facesContext the <code>FacesContext</code>. * @param writer the <code>ResponseWriter</code>. * @param uiData the <code>UIData</code> being rendered. * @throws IOException if an exceptoin occurs. */ protected void renderRowStart( FacesContext facesContext, ResponseWriter writer, UIData uiData, Styles styles, int rowStyleIndex) throws IOException { writer.startElement(HTML.TR_ELEM, null); // uiData); renderRowStyle(facesContext, writer, uiData, styles, rowStyleIndex); Object rowId = uiData.getAttributes().get(org.apache.myfaces.shared.renderkit.JSFAttr.ROW_ID); if (rowId != null) { writer.writeAttribute(HTML.ID_ATTR, rowId.toString(), null); } }
/** * Renders the start of a new row of body content. * @param facesContext the <code>FacesContext</code>. * @param writer the <code>ResponseWriter</code>. * @param uiData the <code>UIData</code> being rendered. * @throws IOException if an exceptoin occurs. */ protected void renderRowStart( FacesContext facesContext, ResponseWriter writer, UIData uiData, Styles styles, int rowStyleIndex) throws IOException { writer.startElement(HTML.TR_ELEM, uiData); renderRowStyle(facesContext, writer, uiData, styles, rowStyleIndex); Object rowId = uiData.getAttributes().get(org.apache.myfaces.shared_impl.renderkit.JSFAttr.ROW_ID); if (rowId != null) { writer.writeAttribute(HTML.ID_ATTR, rowId.toString(), null); } }
/** * Renders the start of a new row of body content. * @param facesContext the <code>FacesContext</code>. * @param writer the <code>ResponseWriter</code>. * @param uiData the <code>UIData</code> being rendered. * @throws IOException if an exceptoin occurs. */ protected void renderRowStart( FacesContext facesContext, ResponseWriter writer, UIData uiData, Styles styles, int rowStyleIndex) throws IOException { writer.startElement(HTML.TR_ELEM, uiData); renderRowStyle(facesContext, writer, uiData, styles, rowStyleIndex); Object rowId = uiData.getAttributes().get(org.apache.myfaces.shared_impl.renderkit.JSFAttr.ROW_ID); if (rowId != null) { writer.writeAttribute(HTML.ID_ATTR, rowId.toString(), null); } }
/** * Renders the start of a new row of body content. * @param facesContext the <code>FacesContext</code>. * @param writer the <code>ResponseWriter</code>. * @param uiData the <code>UIData</code> being rendered. * @throws IOException if an exceptoin occurs. */ protected void renderRowStart( FacesContext facesContext, ResponseWriter writer, UIData uiData, Styles styles, int rowStyleIndex) throws IOException { writer.startElement(HTML.TR_ELEM, uiData); renderRowStyle(facesContext, writer, uiData, styles, rowStyleIndex); Object rowId = uiData.getAttributes().get(org.apache.myfaces.shared_impl.renderkit.JSFAttr.ROW_ID); if (rowId != null) { writer.writeAttribute(HTML.ID_ATTR, rowId.toString(), null); } }
/** * Renders the start of a new row of body content. * @param facesContext the <code>FacesContext</code>. * @param writer the <code>ResponseWriter</code>. * @param uiData the <code>UIData</code> being rendered. * @param styles the styleClasses of rows and columns * @param rowStyleIndex the index of the row * @throws IOException if an exceptoin occurs. */ protected void renderRowStart( FacesContext facesContext, ResponseWriter writer, UIData uiData, Styles styles, int rowStyleIndex) throws IOException { writer.startElement(HTML.TR_ELEM, uiData); renderRowStyle(facesContext, writer, uiData, styles, rowStyleIndex); Object rowId = uiData.getAttributes().get(org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr.ROW_ID); if (rowId != null) { writer.writeAttribute(HTML.ID_ATTR, rowId.toString(), null); } }