Package org.primefaces.component.panelgrid

Examples of org.primefaces.component.panelgrid.PanelGrid


public class PanelGridRenderer extends org.primefaces.component.panelgrid.PanelGridRenderer {

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        PanelGrid grid = (PanelGrid) component;
        String clientId = grid.getClientId(context);
        int columns = grid.getColumns();
        if(columns == 0) {
            columns = 1;
        }
        String gridClass = MobileUtils.GRID_MAP.get(columns);
        String style = grid.getStyle();
        String styleClass = grid.getStyleClass();
        styleClass = (styleClass == null) ? gridClass : gridClass + " " + styleClass;
       
        writer.startElement("div", grid);
        writer.writeAttribute("id", clientId, "id");
        writer.writeAttribute("class", styleClass, "styleClass");
        if(style != null) {
            writer.writeAttribute("style", style, "style");
        }
       
        int i = 0;
        for(UIComponent child : grid.getChildren()) {
            if(child.isRendered()) {
                int blockKey = (i % columns);
                String blockClass = MobileUtils.BLOCK_MAP.get(blockKey);
                writer.startElement("div", null);
                writer.writeAttribute("class", blockClass, null);
View Full Code Here

TOP

Related Classes of org.primefaces.component.panelgrid.PanelGrid

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.