Package org.openfaces.component.table

Examples of org.openfaces.component.table.RowGrouping


        return Column.FACET_GROUP_HEADER;
    }

    @Override
    protected List<HtmlOutputText> getDefaultChildList(DataTable dataTable, FacesContext context) {
        RowGrouping rowGrouping = dataTable.getRowGrouping();
        HtmlOutputText outputText = (HtmlOutputText) context.getApplication().createComponent(HtmlOutputText.COMPONENT_TYPE);
        outputText.setValueExpression("value", rowGrouping.getGroupHeaderTextExpression());
        return Collections.singletonList(outputText);
    }
View Full Code Here


        if (sortingToggleMode == SortingToggleMode.AUTODETECT) {
            String columnId = column.getId();
            Boolean ascending = null;
            if (table instanceof DataTable) {
                DataTable dataTable = (DataTable) table;
                RowGrouping rowGrouping = dataTable.getRowGrouping();
                if (rowGrouping != null)
                    ascending = isColumnSortedAscending(columnId, rowGrouping.getGroupingRules());
            }
            if (ascending == null)
                ascending = isColumnSortedAscending(columnId, table.getSortingRules());

            if (ascending == null) return;
View Full Code Here

            AbstractTable table) throws IOException {
        super.encodeAdditionalFeaturesSupport(context, table);

        DataTable dataTable = (DataTable) table;

        RowGrouping rowGrouping = dataTable.getRowGrouping();
        if (rowGrouping != null)
            rowGrouping.encodeAll(context);
    }
View Full Code Here

        if (!uiComponent.isRendered())
            return;
        DataTable table = (DataTable) uiComponent;
        decodePagination(context, table);

        RowGrouping rowGrouping = table.getRowGrouping();
        if (rowGrouping != null)
            rowGrouping.processDecodes(context);
    }
View Full Code Here

public class RowGroupingRenderer extends RendererBase {
    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        super.encodeBegin(context, component);

        RowGrouping rowGrouping = (RowGrouping) component;
        UIComponent parent = rowGrouping.getParent();
        if (!(parent instanceof DataTable))
            throw new IllegalStateException("<o:columnResizing> can only be placed as a child component inside of " +
                    "a <o:dataTable> component. Though the following parent component has been encountered: " +
                    parent.getClass().getName());
        DataTable table = (DataTable) rowGrouping.getParent();

        TableStructure tableStructure = TableStructure.getCurrentInstance(table);
        Set<BaseColumn> visibleAndGroupedColumns = new LinkedHashSet<BaseColumn>(tableStructure.getColumns());
        List<GroupingRule> groupingRules = rowGrouping.getGroupingRules();
        if (groupingRules != null)
            for (GroupingRule groupingRule : groupingRules) {
                String columnId = groupingRule.getColumnId();
                BaseColumn column = table.getColumnById(columnId);
                visibleAndGroupedColumns.add(column);
            }

        String tableClientId = table.getClientId(context);
        List<String> activeColumnIds = new ArrayList<String>();
        List<String> groupableColumnIds = new ArrayList<String>();
        for (BaseColumn column : visibleAndGroupedColumns) {
            Object headerContent = TableHeader.getHeaderOrFooterCellContent(column, true);
            HeaderCell cell = new HeaderCell(column, headerContent, "div",
                    CellKind.COL_HEADER, true, HeaderCell.SortingToggleMode.AUTODETECT);
            String columnId = column.getId();
            activeColumnIds.add(columnId);
            cell.setId(tableClientId + "::groupingHeaderCell:" + columnId);
            cell.setTableStructure(tableStructure);
            cell.render(context, null);

            if (column.isColumnGroupable())
                groupableColumnIds.add(columnId);
        }

        ScriptBuilder buf = new ScriptBuilder();

        boolean foldingRequired = AbstractTableRenderer.encodeFoldingSupport(context, buf, table);

        Rendering.renderInitScript(context, buf.initScript(context, table, "O$.Table._initRowGrouping",
                activeColumnIds,
                groupableColumnIds,
                groupingRules,
                AbstractTableRenderer.DEFAULT_SORTABLE_HEADER_CLASS,
                rowGrouping.getGroupOnHeaderClick(),
                rowGrouping.getHideGroupingColumns()
        ).semicolon(), foldingRequired
                ? new String[]{AbstractTableRenderer.treeTableJsURL(context)}
                : new String[0]);
    }
View Full Code Here

    }

    @Override
    public void decode(FacesContext context, UIComponent component) {
        super.decode(context, component);
        RowGrouping rowGrouping = (RowGrouping) component;
        decodeGroupingRules(context, rowGrouping);

    }
View Full Code Here

TOP

Related Classes of org.openfaces.component.table.RowGrouping

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.