Package org.apache.click

Examples of org.apache.click.ActionListener


        // Add the parametrized submit link to the FieldSet
        fieldSet.add(paramLink);

        // The Parametrized SubmitLink action listener
        paramLink.setActionListener(new ActionListener() {

            public boolean onAction(Control source) {
                String demo2Msg = paramLink.getName() + ".onAction invoked at "
                    + (new Date());
                demo2Msg += "<br>Parameters:" + paramLink.getParameters();
View Full Code Here


        // Add the Standalone SubmitLink to the Page
        addControl(standaloneLink);

        // The Standalone SubmitLink action listener
        standaloneLink.setActionListener(new ActionListener() {

            public boolean onAction(Control source) {
                String demo3Msg = source.getName() + ".onAction invoked at " +
                    (new Date());
                addModel("demo3Msg", demo3Msg);
View Full Code Here

        // is defined in the page template -> submit-link-demo.htm
        String clickEvent = "return confirmSubmit(this, '" + form.getId() + "', 'Are you sure?');";
        confirmationLink.setOnClick(clickEvent);

        // The Parametrized SubmitLink action listener
        confirmationLink.setActionListener(new ActionListener() {

            public boolean onAction(Control source) {
                String demo4Msg = confirmationLink.getName() + ".onAction invoked at "
                    + (new Date());
                addModel("demo4Msg", demo4Msg);
View Full Code Here

    public boolean onProcess() {
        getExpandLink().onProcess();
        getSelectLink().onProcess();
        bindRequestValue();

        ActionEventDispatcher.dispatchActionEvent(this, new ActionListener() {
            public boolean onAction(Control source) {
                return postProcess();
            }
        });
        return true;
View Full Code Here

    @Override
    public void onInit() {
        super.onInit();

        ActionLink link = new ActionLink("export");
        link.setActionListener(new ActionListener() {
            private static final long serialVersionUID = 1L;

            public boolean onAction(Control source) {
                export();
                return false;
View Full Code Here

        fieldSet.add(investmentSelect);

        fieldSet.add(toggle);

        fieldSet.add(submit);
        submit.setActionListener(new ActionListener() {

            public boolean onAction(Control source) {

                if (form.isValid()) {
                    // Copy field values to customer
View Full Code Here

        panel2.add(form);

        final TextField field = new TextField("name", "Enter your name");
        form.add(field);
        Submit submit = new Submit("go");
        submit.setActionListener(new ActionListener() {

            public boolean onAction(Control source) {
                addModel("msg", "Hi " + field.getValue() + ". Your form has been saved!");
                return true;
            }
        });

        form.add(submit);

        panel2.setLabel("The Second Panel");
        tabbedPanel.add(panel2);

        Panel panel3 = new Panel("panel3", "panel/tabbed/table-panel3.htm");
        Table table = new Table("table");
        table = new Table("table");

        table.setClass(Table.CLASS_ITS);

        table.addColumn(new Column("id"));
        table.addColumn(new Column("name"));
        table.addColumn(new Column("email"));
        table.addColumn(new Column("investments"));
        table.setPageSize(5);
        table.setSortable(true);

        List list = customerService.getCustomersSortedByName(100);
        table.setRowList(list);

        panel3.add(table);

        tabbedPanel.add(panel3);

        // NOTE: Save the TabbedPanel state when a new panel is activated.
        // Register a listener that is notified when a different panel is selected.
        tabbedPanel.setTabListener(new ActionListener() {
            public boolean onAction(Control source) {
                // Save the TabbedPanel state to the session
                tabbedPanel.saveState(getContext());
                return true;
            }
View Full Code Here

        context.getMockRequest().setParameter(ActionLink.VALUE, "panel2");

        tabbedPanel.add(new Panel("panel1"));
        tabbedPanel.add(new Panel("panel2"));

        tabbedPanel.setTabListener(new ActionListener() {
            private static final long serialVersionUID = 1L;

            public boolean onAction(Control source) {
                return false;
            }
View Full Code Here

        // Create and add submit button *before* adding the textField
        Submit submit = new Submit("submit");
        form.add(submit);

        // Add listener on submit button
        submit.setActionListener(new ActionListener() {
            public boolean onAction(Control source) {
                // Assert that this listener can access the textfield value
                Assert.assertEquals("one", form.getFieldValue("field"));
                success = true;
                return true;
View Full Code Here

        TabbedPanel tabbedPanel = new TabbedPanel("tabbedPanel");
        tabbedPanel.add(new Panel("panel1"));
        tabbedPanel.add(new Panel("panel2"));

        tabbedPanel.setTabListener(new ActionListener() {
            public boolean onAction(Control source) {
                return false;
            }
        });
View Full Code Here

TOP

Related Classes of org.apache.click.ActionListener

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.