Package org.apache.cocoon.forms.event

Examples of org.apache.cocoon.forms.event.RepeaterEvent


    public void initialize() {
        for (int i = 0; i < this.rows.size(); i++) {
            ((RepeaterRow)rows.get(i)).initialize();
            // TODO(SG) Is this safe !?
            broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_ADDED, i));
        }
        super.initialize();
    }
View Full Code Here


    public RepeaterRow addRow() {
        RepeaterRow repeaterRow = new RepeaterRow(definition);
        rows.add(repeaterRow);
        repeaterRow.initialize();
        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_ADDED, rows.size() - 1));
        return repeaterRow;
    }
View Full Code Here

        } else {
            rows.add(index, repeaterRow);
        }
        repeaterRow.initialize();
        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_ADDED, index));
        return repeaterRow;
    }
View Full Code Here

    /**
     * @throws IndexOutOfBoundsException if the the index is outside the range of existing rows.
     */
    public void removeRow(int index) {
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_DELETING, index));
        rows.remove(index);
        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_DELETED, index));
    }
View Full Code Here

        } else {
            this.rows.add(to, fromRow);
        }

        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROWS_REARRANGED));
    }
View Full Code Here

        Object fromRow = this.rows.remove(from);
        this.rows.add(to, fromRow);

        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROWS_REARRANGED));
    }
View Full Code Here

            Object temp = this.rows.get(index-1);
            this.rows.set(index-1, this.rows.get(index));
            this.rows.set(index, temp);
        }
        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROWS_REARRANGED));
    }
View Full Code Here

            Object temp = this.rows.get(index+1);
            this.rows.set(index+1, this.rows.get(index));
            this.rows.set(index, temp);
        }
        getForm().addWidgetUpdate(this);
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROWS_REARRANGED));
    }
View Full Code Here

    /**
     * Clears all rows from the repeater and go back to the initial size
     */
    public void clear() {
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROWS_CLEARING));
        rows.clear();
        broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROWS_CLEARED));

        // and reset to initial size
        for (int i = 0; i < this.definition.getInitialSize(); i++) {
            addRow();
        }
View Full Code Here

    public void initialize() {
        for (int i = 0; i < this.rows.size(); i++) {
            ((RepeaterRow)rows.get(i)).initialize();
            // TODO(SG) Is this safe !?
            broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_ADDED, i));
        }
        super.initialize();
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.forms.event.RepeaterEvent

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.