Package org.apache.click.control

Examples of org.apache.click.control.Form


    public FormProperties() {

        // Setup demonstration form

        form = new Form("form");

        FieldSet fieldSet = new FieldSet("demo", "<b>Demonstration Form</b>");
        form.add(fieldSet);

        nameField = new TextField("name");
        nameField.setRequired(true);
        nameField.setFocus(true);
        fieldSet.add(nameField);

        emailField = new EmailField("email");
        emailField.setRequired(true);
        fieldSet.add(emailField);

        investmentsField = new InvestmentSelect("investments");
        fieldSet.add(investmentsField);

        dateJoinedField = new DateField("dateJoined");
        fieldSet.add(dateJoinedField);

        form.add(new Submit("ok", "  OK  ", this, "onOkClick"));

        Submit cancel = new PageSubmit("cancel", HomePage.class);
        cancel.setCancelJavaScriptValidation(true);
        form.add(cancel);

        addControl(form);

        // Setup control form

        optionsForm = new Form("optionsForm");
        optionsForm.setColumns(3);
        optionsForm.setLabelAlign("right");
        optionsForm.setListener(this, "onApplyChanges");
        optionsForm.setLabelStyle("padding-left:2em;");
View Full Code Here


    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);
View Full Code Here

    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");
View Full Code Here

    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() {
View Full Code Here

    /**
     * Builds the user interface for users to change the tree options interactively.
     */
    public void buildOptionsUI() {
        //Form to handle user selected options
        optionsForm = new Form("optionForm");
        FieldSet fieldSet = new FieldSet("options", "Form Options");
        fieldSet.add(jsEnabled);
        fieldSet.add(rootNodeDisplayed);
        optionsForm.add(fieldSet);

View Full Code Here

        super.onInit();

        // The checkbox tree needs to be placed inside a form so all the
        // checkbox values can be submitted to the server when we submit
        // the form.
        form = new Form("form");

        //Create the tree and tree model and add it to the page
        tree = buildTree();
        tree.addListener(this);
View Full Code Here

    /**
     * Builds the user interface for users to change the tree options interactively.
     */
    public void buildOptionsUI() {
        //Form to handle user selected options
        optionsForm = new Form("optionForm");
        FieldSet fieldSet = new FieldSet("options", "Form Options");
        fieldSet.add(jsEnabled);
        fieldSet.add(rootNodeDisplayed);
        fieldSet.add(selectChildNodes);
        optionsForm.add(fieldSet);
View Full Code Here

*/
public class ControlHeadDemo extends BorderPage {

    public ControlHeadDemo() {

        Form form = new Form("form");

        StarRating rating = new StarRating("rating", 5, 2);
        form.add(rating);

        form.add(new Submit("submit"));

        addControl(form);
    }
View Full Code Here

        if (!ArrayUtils.isEmpty(expandOrCollapseNodeIds)) {
            expandOrCollapse(expandOrCollapseNodeIds);
        }

        // Try and locate a parent form
        Form form = ContainerUtils.findForm(this);
        if (form != null) {
            // If the form was submitted, invoke bindSelectOrDeselectValues()
            if (form.isFormSubmission()) {
                onFormSubmission();
            }
        }
        return true;
    }
View Full Code Here

        field.setName(getName() + "_" + rowIndex);

        if (getTable() instanceof FormTable) {
            FormTable formTable = (FormTable) getTable();
            Form form = formTable.getForm();

            if (formTable.getRenderSubmittedValues()
                && !formTable.getControlLink().isClicked()
                && form.isFormSubmission()) {

                field.onProcess();

                if (field.getError() != null) {
                    field.setTitle(field.getError());
View Full Code Here

TOP

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

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.