Examples of SubmitLink


Examples of org.apache.click.extras.control.SubmitLink

        demo4();
    }

    public void demo1() {
        // Create a submit link.
        final SubmitLink submitLink = new SubmitLink("submit");

        Form form = new Form("demo1");
        addControl(form);

        FieldSet fieldSet = new FieldSet("fieldSet");
        form.add(fieldSet);

        fieldSet.add(new TextField("name"));

        // Add the submit link to the fieldSet
        fieldSet.add(submitLink);

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

            public boolean onAction(Control source) {
                demo1Msg = submitLink.getName() + ".onAction invoked at "
                    + (new Date());
                return true;
            }
        });
    }
View Full Code Here

Examples of org.apache.click.extras.control.SubmitLink

        });
    }

    public void demo2() {
        // Create a submit link which includes parameters.
        final SubmitLink paramLink = new SubmitLink("paramLink");

        Form form = new Form("demo2");
        addControl(form);

        FieldSet fieldSet = new FieldSet("fieldSet");
        form.add(fieldSet);

        fieldSet.add(new TextField("name"));

        // Add some parameters to the parameterized submit link
        paramLink.setValue("myValue");
        paramLink.setParameter("x", "100");

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

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

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

Examples of org.apache.click.extras.control.SubmitLink

        });
    }

    public void demo3() {
        // Create a standalone submit link.
        final SubmitLink standaloneLink = new SubmitLink("standaloneLink");

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

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

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

Examples of org.apache.click.extras.control.SubmitLink

        });
    }

    public void demo4() {
        // Create a submit link
        final SubmitLink confirmationLink = new SubmitLink("confirmationLink");

        Form form = new Form("demo4");
        addControl(form);

        FieldSet fieldSet = new FieldSet("fieldSet");
        form.add(fieldSet);

        fieldSet.add(new TextField("name"));

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

        // Set custom JavaScript for the onclick event. The confirmSubmit function
        // is defined in the page template -> submit-link-demo.htm
        String clickEvent = "return confirmSubmit(this, '" + form.getName() + "', 'Are you sure?');";
        confirmationLink.setOnClick(clickEvent);

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

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

Examples of org.apache.click.extras.control.SubmitLink

     *
     * @return the tree node expand / collapse link
     */
    public ActionLink getExpandLink() {
        if (expandLink == null) {
            expandLink = new SubmitLink();
        }
        return expandLink;
    }
View Full Code Here

Examples of org.apache.click.extras.control.SubmitLink

     *
     * @return the tree node select / deselect link.
     */
    public ActionLink getSelectLink() {
        if (selectLink == null) {
            selectLink = new SubmitLink();
        }
        return selectLink;
    }
View Full Code Here

Examples of org.apache.click.extras.control.SubmitLink

    // Public Methods --------------------------------------------------------

    public void demo1() {
        // Create a submit link.
        final SubmitLink submitLink = new SubmitLink("save");

        Form form = new Form("demo1");
        addControl(form);

        FieldSet fieldSet = new FieldSet("fieldSet");
        form.add(fieldSet);

        fieldSet.add(new TextField("name"));

        // Add the submit link to the fieldSet
        fieldSet.add(submitLink);

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

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

Examples of org.apache.click.extras.control.SubmitLink

        });
    }

    public void demo2() {
        // Create a submit link which includes parameters.
        final SubmitLink paramLink = new SubmitLink("paramLink");

        Form form = new Form("demo2");
        addControl(form);

        FieldSet fieldSet = new FieldSet("fieldSet");
        form.add(fieldSet);

        fieldSet.add(new TextField("name"));

        // Add some parameters to the parametrized submit link
        paramLink.setValue("myValue");
        paramLink.setParameter("x", "100");

        // 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();
                addModel("demo2Msg", demo2Msg);
                return true;
            }
        });
    }
View Full Code Here

Examples of org.apache.click.extras.control.SubmitLink

        });
    }

    public void demo3() {
        // Create a standalone submit link.
        final SubmitLink standaloneLink = new SubmitLink("standaloneLink");

        // 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

Examples of org.apache.click.extras.control.SubmitLink

        });
    }

    public void demo4() {
        // Create a submit link
        final SubmitLink confirmationLink = new SubmitLink("confirmationLink");

        Form form = new Form("demo4");
        addControl(form);

        FieldSet fieldSet = new FieldSet("fieldSet");
        form.add(fieldSet);

        fieldSet.add(new TextField("name"));

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

        // Set custom JavaScript for the onclick event. The confirmSubmit function
        // 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);
                return true;
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.