Package org.openfaces.component.table

Examples of org.openfaces.component.table.BaseColumn$ExpressionData


            boolean isHeader,
            boolean skipEmptyHeaders) {
        int columnHierarchyLevels = 0;
        for (int colIndex = 0, colCount = columns.size(); colIndex < colCount; colIndex++) {
            List<BaseColumn> columnHierarchy = new ArrayList<BaseColumn>();
            BaseColumn startingColumn = columns.get(colIndex);
            for (BaseColumn column = startingColumn;
                 column != null;
                 column = column.getParent() instanceof BaseColumn ? (BaseColumn) column.getParent() : null) {
                if (skipEmptyHeaders && column != startingColumn) {
                    Object header = getHeaderOrFooterCellContent(column, isHeader);
View Full Code Here


        } else {
            if (!firstFooterRow && rowIndex >= thisHierarchySize - 1)
                return null;
        }

        BaseColumn col = (BaseColumn) columnHierarchy.get(firstFooterRow ? thisHierarchySize - 1 : rowIndex);
        int colSpan = 1;
        for (int nextColIndex = colIndex + 1, colCount = columnHierarchies.length; nextColIndex < colCount; nextColIndex++) {
            List nextColumnHierarchy = columnHierarchies[nextColIndex];
            if (rowIndex >= nextColumnHierarchy.size())
                break;
            BaseColumn nextCol = (BaseColumn) nextColumnHierarchy.get(rowIndex);
            if (nextCol != col)
                break;
            colSpan++;
        }
View Full Code Here

        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();
View Full Code Here

            else {
                UIComponent parent = filter.getParent();
                if (parent == null || !(parent instanceof BaseColumn))
                    condition = FilterCondition.CONTAINS;
                else {
                    BaseColumn column = (BaseColumn) parent;
                    if (expression instanceof ValueExpression) {
                        BaseColumn.ExpressionData data = column.getExpressionData((ValueExpression) expression);
                        if (data == null) {
                            AbstractTable table = column.getTable();
                            String var = table.getVar();
                            throw new FacesException(
                                    "Can't find column output component (UIOutput component with a value expression containing variable \"" +
                                            var + "\") for column with id: \"" + column.getId() + "\"; table id: \"" + table.getId() +
                                            "\" ; consider declaring the filter expression explicitly if you're using a filter component in this column.");
                        }
                        Class type = data.getValueType();

                        if (String.class.equals(type))
View Full Code Here

    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        AbstractTable table = getTable(component);
        if (table == null)
            throw new IllegalStateException("SelectionColumn must be nested inside a table");
        BaseColumn col = getColumn(component);
        boolean checkBoxColHeader = col instanceof CheckboxColumn;
        AbstractTableSelection selection;
        if (!checkBoxColHeader) {
            selection = table.getSelection();
            if (selection == null)
View Full Code Here

        super.renderInitScript(facesContext, checkbox, imagesObj, stylesObj, onchangeFunction, triStateAllowed);

        AbstractTable table = getTable(checkbox);
        if (table == null)
            throw new IllegalStateException("SelectionColumn must be nested inside a table");
        BaseColumn col = getColumn(checkbox);

        FacesContext context = FacesContext.getCurrentInstance();
        ScriptBuilder buf = new ScriptBuilder();
        Integer checkboxColIndex = col instanceof CheckboxColumn ? table.getRenderedColumns().indexOf(col) : null;
        buf.initScript(context, checkbox, "O$.Table._initSelectAllCheckbox", table, checkboxColIndex).semicolon();
View Full Code Here

        AbstractTable table = (AbstractTable) component.getParent();

        JSONObject columnParams = new JSONObject();
        List<BaseColumn> columns = table.getRenderedColumns();
        for (int i = 0; i < columns.size(); i++) {
            BaseColumn column = columns.get(i);
            boolean resizable = column.isResizable();
            String minResizingWidth = column.getMinResizingWidth();
            if (!resizable || minResizingWidth != null) {
                JSONObject thisColumnParams = new JSONObject();
                try {
                    if (!resizable)
                        thisColumnParams.put("resizable", resizable);
View Full Code Here

            resizingState = new ColumnResizingState();

        resizingState.setTableWidth(tableWidth);

        for (int i = 0, count = columns.size(); i < count; i++) {
            BaseColumn column = columns.get(i);
            String newWidth;
            try {
                newWidth = widthsArray.getString(i);
            } catch (JSONException e) {
                throw new RuntimeException(e);
            }

            resizingState.setColumnWidth(column.getId(), newWidth);
        }

        if (submittedColumnsOrder != null) {
            if (table.getColumnsOrder() != null && ValueBindings.set(table, "columnsOrder", table.getColumnsOrder())) {
                table.setColumnsOrder(null);
View Full Code Here

TOP

Related Classes of org.openfaces.component.table.BaseColumn$ExpressionData

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.