Package org.apache.click.control

Examples of org.apache.click.control.Column


        select.setOptionLabel("name");
        select.setOptional(true);
        form.add(select);

        // Table
        table.addColumn(new Column("id"));
        table.addColumn(new Column("name"));
        table.addColumn(new Column("studentHouse")).setDecorator(new Decorator() {

            public String render(Object object, Context context) {
                Student student = (Student) object;
                if (student.getStudentHouse() != null) {
                    return student.getStudentHouse().getName();
View Full Code Here


        // Complete form initialization
        form.add(new Submit("save", " Save ", this, "onSaveClick"));
        form.add(new Submit("cancel", "Cancel", this, "onCancelClick"));

        // Complete table initialization
        Column column = new Column("Action");
        column.setSortable(false);
        column.setAttribute("width", "100px;");
        ActionLink[] links = new ActionLink[]{editLink, removeLink};
        column.setDecorator(new LinkDecorator(table, links, "id"));
        table.addColumn(column);

        removeLink.setAttribute("onclick", "return window.confirm('Are you sure you want to delete this record?');");
    }
View Full Code Here

        int firstRow = getFirstRow();
        int lastRow = getLastRow();

        for (int i = 0; i < getColumnList().size(); i++) {
            Column column = (Column) getColumnList().get(i);
            if (column instanceof FieldColumn) {
                Field field = ((FieldColumn) column).getField();

                for (int j = firstRow; j < lastRow; j++) {
                    field.setName(column.getName() + "_" + j);

                    htmlImports = field.getHtmlImports();
                    if (htmlImports != null) {
                        buffer.append(htmlImports);
                    }
View Full Code Here

            int firstRow = getFirstRow();
            int lastRow = getLastRow();

            for (int i = 0; i < getColumnList().size(); i++) {
                Column column = (Column) getColumnList().get(i);
                if (column instanceof FieldColumn) {
                    Field field = ((FieldColumn) column).getField();

                    for (int j = firstRow; j < lastRow; j++) {
                        field.setName(column.getName() + "_" + j);

                        headElements.addAll(field.getHeadElements());
                    }
                }
            }
View Full Code Here

            for (int i = firstRow; i < lastRow; i++) {
                Object row = rowList.get(i);

                for (int j = 0; j < columnList.size(); j++) {

                    Column column = (Column) columnList.get(j);

                    if (column instanceof FieldColumn) {
                        FieldColumn fieldColumn = (FieldColumn) column;
                        Field field = fieldColumn.getField();

                        field.setName(column.getName() + "_" + i);

                        field.onProcess();

                        if (field.isValid()) {
                            fieldColumn.setProperty(row, column.getName(),
                                field.getValueObject());
                        } else {
                            getForm().setError(getMessage("formtable-error"));
                        }
                    }
View Full Code Here

        final List tableColumns = getColumnList();
        final List excludedColumns = getExcludedColumns();

        for (int j = 0; j < tableColumns.size(); j++) {
            Column column = (Column) tableColumns.get(j);
            if (!excludedColumns.contains(column.getName())) {
                column.renderTableHeader(buffer, getContext());
                if (j < tableColumns.size() - 1) {
                    buffer.append("\n");
                }
            }
        }
View Full Code Here

        final List tableColumns = getColumnList();
        final List excludedColumns = getExcludedColumns();

        for (int j = 0; j < tableColumns.size(); j++) {
            Column column = (Column) tableColumns.get(j);
            if (!excludedColumns.contains(column.getName())) {
                column.renderTableData(row, buffer, getContext(), rowIndex);
                if (j < tableColumns.size() - 1) {
                    buffer.append("\n");
                }
            }
        }
View Full Code Here

            for (int i = 0, size = tableColumns.size(); i < size; i++) {
                HSSFCell cell = row.createCell(i);
                cell.setCellStyle(style);

                Column column = (Column) tableColumns.get(i);
                String title = column.getHeaderTitle();
                cell.setCellValue(title);
            }
        }
    }
View Full Code Here

            Object row = table.getRowList().get(rowIndex);

            for (int columnIndex = 0, size = tableColumns.size(); columnIndex <
                size; columnIndex++) {
                HSSFCell cell = excelRow.createCell(columnIndex);
                Column column = (Column) tableColumns.get(columnIndex);
                HSSFCellStyle style = cellStyles.get(column.getName());
                if (style != null) {
                    cell.setCellStyle(style);
                }

                Object columnValue =
View Full Code Here

        // Setup customers table
        table.setClass(Table.CLASS_SIMPLE);
        table.setPageSize(8);
        table.setShowBanner(true);

        Column column = new Column("name");
        column.setWidth("140px");
        table.addColumn(column);

        column = new Column("email");
        column.setAutolink(true);
        column.setWidth("220px");
        table.addColumn(column);

        column = new Column("holdings");
        column.setFormat("${0,number,#,##0.00}");
        column.setTextAlign("right");
        column.setWidth("100px");
        table.addColumn(column);

        column = new Column("dateJoined");
        column.setFormat("{0,date,medium}");
        column.setWidth("90px");
        table.addColumn(column);

        column = new Column("Action");
        column.setSortable(false);
        ActionLink[] links = new ActionLink[]{editLink, deleteLink};
        column.setDecorator(new LinkDecorator(table, links, "id"));
        table.addColumn(column);

        deleteLink.setAttribute("onclick", "return window.confirm('Please confirm delete');");

        table.setDataProvider(new DataProvider<Customer>() {
View Full Code Here

TOP

Related Classes of org.apache.click.control.Column

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.