Package org.primefaces.component.api

Examples of org.primefaces.component.api.UIColumn


        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
        String clientId = tt.getClientId(context);
        String sortKey = params.get(clientId + "_sortKey");
    String sortDir  = params.get(clientId + "_sortDir");
       
        UIColumn sortColumn = tt.findColumn(sortKey);
        ValueExpression sortByVE = sortColumn.getValueExpression("sortBy");
        tt.setValueExpression("sortBy", sortByVE);
        tt.setSortColumn(sortColumn);
        tt.setSortFunction(sortColumn.getSortFunction());
        tt.setSortOrder(sortDir);
    }
View Full Code Here


            writer.startElement("tr", null);
            writer.writeAttribute("class", "ui-bar-a", null);
            writer.writeAttribute("role", "row", null);
           
            for(int i = columnStart; i < columnEnd; i++) {
                UIColumn column = columns.get(i);

                if(column instanceof Column) {
                    encodeColumnHeader(context, table, column);
                }
                else if(column instanceof DynamicColumn) {
View Full Code Here

            writer.writeAttribute("data-rk", rowKey, null);
        }
        writer.writeAttribute("class", rowStyleClass, null);
       
        for(int i = columnStart; i < columnEnd; i++) {
            UIColumn column = columns.get(i);
           
            if(column instanceof Column) {
                encodeCell(context, table, column, clientId, false);
            }
            else if(column instanceof DynamicColumn) {
View Full Code Here

        else {
            writer.startElement("tr", null);
            writer.writeAttribute("role", "row", null);
           
            for(int i = columnStart; i < columnEnd; i++) {
                UIColumn column = columns.get(i);

                if(column instanceof Column) {
                    encodeColumnHeader(context, table, column);
                }
                else if(column instanceof DynamicColumn) {
View Full Code Here

        ResponseWriter writer = context.getResponseWriter();
        List<UIColumn> columns = table.getColumns();
       
        writer.startElement("colgroup", null);
        for(int i = columnStart; i < columnEnd; i++) {
            UIColumn column = columns.get(i);
            if(column.isRendered()) {
                writer.startElement("col", null);
                writer.endElement("col");
            }
        }
        writer.endElement("colgroup");
View Full Code Here

        if(selectionEnabled) {
            writer.writeAttribute("aria-selected", String.valueOf(selected), null);
        }
       
        for(int i = columnStart; i < columnEnd; i++) {
            UIColumn column = columns.get(i);
           
            if(column instanceof Column) {
                encodeCell(context, table, column, clientId, selected);
            }
            else if(column instanceof DynamicColumn) {
View Full Code Here

        }
        else if(table.hasFooterColumn()) {
            writer.startElement("tr", null);
           
            for(int i = columnStart; i < columnEnd; i++) {
                UIColumn column = columns.get(i);

                if(column instanceof Column) {
                    encodeColumnFooter(context, table, column);
                }
                else if(column instanceof DynamicColumn) {
View Full Code Here

        if(selectionEnabled) {
            writer.writeAttribute("aria-selected", String.valueOf(selected), null);
        }

        for(int i=0; i < columns.size(); i++) {
            UIColumn column = columns.get(i);

            if(column.isRendered()) {
                String columnStyleClass = column.getStyleClass();
                String columnStyle = column.getStyle();
                int rowspan = column.getRowspan();
                int colspan = column.getColspan();
               
                writer.startElement("td", null);
                writer.writeAttribute("role", "gridcell", null);
                if(columnStyle != null) writer.writeAttribute("style", columnStyle, null);
                if(columnStyleClass != null) writer.writeAttribute("class", columnStyleClass, null);
                if(rowspan != 1) writer.writeAttribute("rowspan", rowspan, null);
                if(colspan != 1) writer.writeAttribute("colspan", colspan, null);

                if(i == 0) {
                    for(int j = 0; j < depth; j++) {
                        writer.startElement("span", null);
                        writer.writeAttribute("class", TreeTable.INDENT_CLASS, null);
                        writer.endElement("span");
                    }

                    writer.startElement("span", null);
                    writer.writeAttribute("class", icon, null);
                    if(treeNode.isLeaf()) {
                        writer.writeAttribute("style", "visibility:hidden", null);
                    }
                    writer.endElement("span");

                    if(checkboxSelection) {
                        if(!nativeElements)
                            RendererUtils.encodeCheckbox(context, selected, partialSelected, !selectable, Tree.CHECKBOX_CLASS);
                        else
                            renderNativeCheckbox(context, tt, selected, partialSelected);
                    }
                }

                column.renderChildren(context);

                writer.endElement("td");
            }
        }
View Full Code Here

        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
        String clientId = tt.getClientId(context);
        String sortKey = params.get(clientId + "_sortKey");
    String sortDir  = params.get(clientId + "_sortDir");
       
        UIColumn sortColumn = tt.findColumn(sortKey);
        ValueExpression sortByVE = sortColumn.getValueExpression("sortBy");
        tt.setValueExpression("sortBy", sortByVE);
        tt.setSortColumn(sortColumn);
        tt.setSortFunction(sortColumn.getSortFunction());
        tt.setSortOrder(sortDir);
    }
View Full Code Here

            List<SortMeta> multiSortMeta = new ArrayList<SortMeta>();
            String[] sortKeys = sortKey.split(",");
            String[] sortOrders = sortDir.split(",");
           
            for(int i = 0; i < sortKeys.length; i++) {
                UIColumn sortColumn = table.findColumn(sortKeys[i]);
                ValueExpression columnSortByVE = sortColumn.getValueExpression("sortBy");
                String sortField;
           
                if(sortColumn.isDynamic()) {
                    ((DynamicColumn) sortColumn).applyStatelessModel();
                    Object sortByProperty = sortColumn.getSortBy();
                    String field = sortColumn.getField();
                    if(field == null)
                        sortField = (sortByProperty == null) ? table.resolveDynamicField(columnSortByVE) : sortByProperty.toString();
                    else
                        sortField = field;
                }
                else {
                    String field = sortColumn.getField();
                    if(field == null)
                        sortField = (columnSortByVE == null) ? (String) sortColumn.getSortBy() : table.resolveStaticField(columnSortByVE);
                    else
                        sortField = field;
                }
               
                multiSortMeta.add(new SortMeta(sortColumn, sortField, SortOrder.valueOf(convertSortOrderParam(sortOrders[i])), sortColumn.getSortFunction()));
            }
           
            table.setMultiSortMeta(multiSortMeta);
        }
        else {
            UIColumn sortColumn = table.findColumn(sortKey);
            ValueExpression sortByVE = sortColumn.getValueExpression("sortBy");
           
            if(sortColumn.isDynamic()) {
                ((DynamicColumn) sortColumn).applyStatelessModel();
                Object sortBy = sortColumn.getSortBy();
               
                if(sortBy == null)
                    table.setValueExpression("sortBy", sortByVE);
                else
                    table.setSortBy(sortBy);
            }
            else {
                if(sortByVE != null)
                    table.setValueExpression("sortBy", sortByVE);
                else
                    table.setSortBy(sortColumn.getSortBy());
            }
           
            table.setSortColumn(sortColumn);
            table.setSortFunction(sortColumn.getSortFunction());
            table.setSortOrder(convertSortOrderParam(sortDir));
            table.setSortField(sortColumn.getField());
        }
    }
View Full Code Here

TOP

Related Classes of org.primefaces.component.api.UIColumn

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.