Package org.richfaces.renderkit

Examples of org.richfaces.renderkit.TableHolder


            // final ScrollableDataTableRendererState state =
            // ScrollableDataTableRendererState.createState(context, grid);
            // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
            Object savedKey = table.getRowKey();

            final TableHolder holder = new TableHolder(table);

            final SimpleSelection simpleSelection = table.getSelection() == null ? new SimpleSelection()
                    : (SimpleSelection) table.getSelection();

            if (clientSelection.isReset() || clientSelection.isSelectAll()) {
                simpleSelection.clear();
            }

            try {
                table.walk(context, new DataVisitor() {
                    public void process(FacesContext context, Object rowKey,
                            Object argument) throws IOException {

                        // TableHolder holder = (TableHolder) argument;
                        // int i = state.getRowIndex();
                        int i = holder.getRowCounter();

                        if (shouldAddToSelection(i, oldClientSelection,
                                clientSelection)) {

                            simpleSelection.addKey(rowKey);

                        } else if (shouldRemoveFromSelection(i,
                                oldClientSelection, clientSelection)) {

                            simpleSelection.removeKey(rowKey);

                        }

                        if (i == clientSelection.getActiveRowIndex()) {
                            table.setActiveRowKey(rowKey);
                        }
                        holder.nextRow();

                    }
                }, holder);
            } catch (IOException e) {
                throw new FacesException(e);
View Full Code Here


        // final ScrollableDataTableRendererState state =
        // ScrollableDataTableRendererState.createState(context, grid);
        // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
      Object savedKey = table.getRowKey();

        final TableHolder holder = new TableHolder(table);

        final Selection gridSelection = table.getSelection() == null ? new SimpleSelection()
                : table.getSelection();
        final ClientSelection clientSelection = new ClientSelection();

        table.walk(context, new DataVisitor() {
            public void process(FacesContext context, Object rowKey,
                    Object argument) throws IOException {

                // TableHolder holder = (TableHolder) argument;

                if (gridSelection.isSelected(rowKey)) {

                    int i = holder.getRowCounter();

                    clientSelection.addIndex(i);
                }

                if (rowKey.equals(table.getActiveRowKey())) {
                    clientSelection.setActiveRowIndex(holder.getRowCounter());
                }

                holder.nextRow();

            }
        }, holder);

        // ScrollableDataTableRendererState.restoreState(context);
View Full Code Here

            // final ScrollableDataTableRendererState state =
            // ScrollableDataTableRendererState.createState(context, grid);
            // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));

            final TableHolder holder = new TableHolder(table);

            final SimpleSelection simpleSelection = table.getSelection() == null ? new SimpleSelection()
                    : (SimpleSelection) table.getSelection();

            if (clientSelection.isReset() || clientSelection.isSelectAll()) {
                simpleSelection.clear();
            }

            try {
                table.walk(context, new DataVisitor() {
                    public void process(FacesContext context, Object rowKey,
                            Object argument) throws IOException {

                        // TableHolder holder = (TableHolder) argument;
                        // int i = state.getRowIndex();
                        int i = holder.getRowCounter();

                        if (shouldAddToSelection(i, oldClientSelection,
                                clientSelection)) {

                            simpleSelection.addKey(rowKey);

                        } else if (shouldRemoveFromSelection(i,
                                oldClientSelection, clientSelection)) {

                            simpleSelection.removeKey(rowKey);

                        }

                        if (i == clientSelection.getActiveRowIndex()) {
                            table.setActiveRowKey(rowKey);
                        }
                        holder.nextRow();

                    }
                }, holder);
            } catch (IOException e) {
                throw new FacesException(e);
View Full Code Here

        // final ScrollableDataTableRendererState state =
        // ScrollableDataTableRendererState.createState(context, grid);
        // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));

        final TableHolder holder = new TableHolder(table);

        final Selection gridSelection = table.getSelection() == null ? new SimpleSelection()
                : table.getSelection();
        final ClientSelection clientSelection = new ClientSelection();

        table.walk(context, new DataVisitor() {
            public void process(FacesContext context, Object rowKey,
                    Object argument) throws IOException {

                // TableHolder holder = (TableHolder) argument;

                if (gridSelection.isSelected(rowKey)) {

                    int i = holder.getRowCounter();

                    clientSelection.addIndex(i);
                }

                if (rowKey.equals(table.getActiveRowKey())) {
                    clientSelection.setActiveRowIndex(holder.getRowCounter());
                }

                holder.nextRow();

            }
        }, holder);

        // ScrollableDataTableRendererState.restoreState(context);
View Full Code Here

            // final ScrollableDataTableRendererState state =
            // ScrollableDataTableRendererState.createState(context, grid);
            // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
            Object savedKey = table.getRowKey();

            final TableHolder holder = new TableHolder(table);

            final SimpleSelection simpleSelection = table.getSelection() == null ? new SimpleSelection()
                    : (SimpleSelection) table.getSelection();

            if (clientSelection.isReset() || clientSelection.isSelectAll()) {
                simpleSelection.clear();
            }

            try {
                table.walk(context, new DataVisitor() {
                    public void process(FacesContext context, Object rowKey,
                            Object argument) throws IOException {

                        // TableHolder holder = (TableHolder) argument;
                        // int i = state.getRowIndex();
                        int i = holder.getRowCounter();

                        if (shouldAddToSelection(i, oldClientSelection,
                                clientSelection)) {

                            simpleSelection.addKey(rowKey);

                        } else if (shouldRemoveFromSelection(i,
                                oldClientSelection, clientSelection)) {

                            simpleSelection.removeKey(rowKey);

                        }

                        if (i == clientSelection.getActiveRowIndex()) {
                            table.setActiveRowKey(rowKey);
                        }
                        holder.nextRow();

                    }
                }, holder);
            } catch (IOException e) {
                throw new FacesException(e);
View Full Code Here

        // final ScrollableDataTableRendererState state =
        // ScrollableDataTableRendererState.createState(context, grid);
        // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
      Object savedKey = table.getRowKey();

        final TableHolder holder = new TableHolder(table);

        final Selection gridSelection = table.getSelection() == null ? new SimpleSelection()
                : table.getSelection();
        final ClientSelection clientSelection = new ClientSelection();

        table.walk(context, new DataVisitor() {
            public void process(FacesContext context, Object rowKey,
                    Object argument) throws IOException {

                // TableHolder holder = (TableHolder) argument;

                if (gridSelection.isSelected(rowKey)) {

                    int i = holder.getRowCounter();

                    clientSelection.addIndex(i);
                }

                if (rowKey.equals(table.getActiveRowKey())) {
                    clientSelection.setActiveRowIndex(holder.getRowCounter());
                }

                holder.nextRow();

            }
        }, holder);

        // ScrollableDataTableRendererState.restoreState(context);
View Full Code Here

TOP

Related Classes of org.richfaces.renderkit.TableHolder

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.