Package org.apache.click.control

Examples of org.apache.click.control.Submit


        // Row 3
        form1.add(new TextField("name"));
        form1.add(new TextField("type"));
        form1.add(new TelephoneField("telephone"));

        form1.add(new Submit("ok", " OK "));
        form1.add(new PageSubmit("cancel", HomePage.class));

        //-------
        // Form 2
        form2.setColumns(2);

        FieldSet fieldSet = new FieldSet("fieldSet", "FieldSet");
        form2.add(fieldSet);

        // Row 1
        fieldSet.add(new TextField("name"));
        fieldSet.add(new TextField("type"));

        // Row 2
        fieldSet.add(new TextArea("description", 39, 3), 2);

        // Row 3
        fieldSet.add(new EmailField("email"), 2);

        // Row 4
        fieldSet.add(new TelephoneField("telephone"));

        fieldSet.add(new Submit("ok", " OK "));
        fieldSet.add(new PageSubmit("cancel", HomePage.class));
    }
View Full Code Here


        typeSelect.addAll(new String[] {"ID", "Name", "Age"});
        typeSelect.setValue("Name");
        typeSelect.setStyle("font-size", "9pt");
        form.add(typeSelect);

        form.add(new Submit("go", " Go "));
    }
View Full Code Here

        column = new FieldColumn("active", new Checkbox());
        column.setTextAlign("center");
        table.addColumn(column);

        table.getForm().add(new Submit("ok", "  OK  ", this, "onOkClick"));
        table.getForm().add(new Submit("cancel", this, "onCancelClick"));
    }
View Full Code Here

     */
    public final void init() {
        getForm().setButtonAlign(Form.ALIGN_RIGHT);
        getForm().setErrorsPosition(Form.POSITION_MIDDLE);

        previous = new Submit("previous");
        previous.setLabel("< Previous");
        getPreviousButton().setActionListener(new ActionListener() {
            public boolean onAction(Control source) {
                return onPrevious();
            }
        });
        form.add(previous);
        if (!getWizardPage().hasPreviousStep(this)) {
            previous.setDisabled(true);
        }

        next = new Submit("next");
        next.setLabel("Next >");
        getNextButton().setActionListener(new ActionListener() {
            public boolean onAction(Control source) {
                return onNext();
            }
        });
        form.add(next);
        if (!getWizardPage().hasNextStep(this)) {
            next.setDisabled(true);
        }

        finish = new Submit("Finish");
        getFinishButton().setActionListener(new ActionListener() {
            public boolean onAction(Control source) {
                return onFinish();
            }
        });
        form.add(finish);
        if (!getWizardPage().isLastStep(this)) {
            finish.setDisabled(true);
        }

        cancel = new Submit("Cancel");
        getCancelButton().setActionListener(new ActionListener() {
            public boolean onAction(Control source) {
                return onCancel();
            }
        });
View Full Code Here

        tree.addListener(this);

        // Add the tree to the form.
        form.add(tree);

        okSubmit = new Submit("select", "Select");
        resetBtn = new Reset("reset", "Reset");

        form.add(okSubmit);
        form.add(resetBtn);
View Full Code Here

        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;");

        fieldSet = new FieldSet("props", "<b>Form Properites</b>");
        optionsForm.add(fieldSet);

        buttonAlignSelect = new Select("buttonAlign");
        buttonAlignSelect.addAll(new String[] { "left", "center", "right" });
        buttonAlignSelect.setTitle("Buttons horizontal alignment");
        buttonAlignSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(buttonAlignSelect);

        columnsSelect = new Select("columns");
        columnsSelect.addAll(new String[] { "1", "2", "3", "4" });
        columnsSelect.setTitle("Number of Form table columns");
        columnsSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(columnsSelect);

        buttonStyle = new TextField("buttonStyle");
        buttonStyle.setTitle("Button td style attribute");
        buttonStyle.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(buttonStyle);

        errorsAlignSelect = new Select("errorsAlign");
        errorsAlignSelect.addAll(new String[] { "left", "center", "right" });
        errorsAlignSelect.setTitle("Errors block horizontal alignment");
        errorsAlignSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(errorsAlignSelect);

        errorsPositionSelect = new Select("errorsPosition");
        errorsPositionSelect.addAll(new String[] { "top", "middle", "bottom" });
        errorsPositionSelect.setTitle("Form errors position");
        errorsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(errorsPositionSelect);

        errorsStyle = new TextField("errorsStyle");
        errorsStyle.setTitle("Errors td style attribute");
        errorsStyle.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(errorsStyle);

        labelAlignSelect = new Select("labelAlign");
        labelAlignSelect.addAll(new String[] { "left", "center", "right" });
        labelAlignSelect.setTitle("Field label alignment");
        labelAlignSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(labelAlignSelect);

        labelsPositionSelect = new Select("labelsPosition");
        labelsPositionSelect.addAll(new String[] {"left", "top"});
        labelsPositionSelect.setTitle("Form labels position");
        labelsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(labelsPositionSelect);

        labelStyle = new TextField("labelStyle");
        labelStyle.setTitle("Label td style attribute");
        labelStyle.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(labelStyle);

        disabledCheckbox = new Checkbox("disabled");
        disabledCheckbox.setAttribute("onclick", "optionsForm.submit();");
        fieldSet.add(disabledCheckbox);

        readonlyCheckbox = new Checkbox("readonly");
        readonlyCheckbox.setAttribute("onclick", "optionsForm.submit();");
        fieldSet.add(readonlyCheckbox);

        fieldStyle = new TextField("fieldStyle");
        fieldStyle.setTitle("Field td style attribute");
        fieldStyle.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(fieldStyle);

        validateCheckbox = new Checkbox("validate");
        validateCheckbox.setAttribute("onclick", "optionsForm.submit();");
        fieldSet.add(validateCheckbox);

        javaScriptValidateCheckbox = new Checkbox("javaScriptValidate", "JavaScript Validate");
        javaScriptValidateCheckbox.setAttribute("onclick", "optionsForm.submit();");
        fieldSet.add(javaScriptValidateCheckbox);

        showBordersCheckbox = new Checkbox("showBorders");
        showBordersCheckbox.setAttribute("onclick", "optionsForm.submit();");
        fieldSet.add(showBordersCheckbox);

        optionsForm.add(new Submit("restoreDefaults", this, "onRestoreDefaults"));

        addControl(optionsForm);

        // Setup showBorders checkbox Javascript using HTML head include and
        // setting the body onload function.
View Full Code Here

        fieldSet.add(investmentSelect);

        fieldSet.add(new DateField("dateJoined", true));
        fieldSet.add(new Checkbox("active"));

        form.add(new Submit("ok", " OK ", this, "onOkClicked"));
        form.add(new Submit("cancel", this, "onCancelClicked"));
    }
View Full Code Here

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

        // construct form1
        form1.add(new TextField("name"));
        form1.add(new Submit("submit", this, "onForm1Submit"));

        // construct form2
        form2.add(new TextField("name"));
        form2.add(new Submit("submit", this, "onForm2Submit"));

        // add form1 and form2 to the page controls.
        addControl(form1);
        addControl(form2);
    }
View Full Code Here

    // ------------------------------------------------------------ Constructor

    public SimpleForm() {
        form.add(new TextField("name", true));
        form.add(new Submit("OK"));

        form.setListener(this, "onSubmit");
    }
View Full Code Here

        fieldset.add(new CreditCardField("cardNumber")).setRequired(true);
        fieldset.add(new IntegerField("expiry"));

        form.add(fieldset);

        Submit ok = new Submit("ok", "OK");
        Submit cancel = new PageSubmit("cancel", ContactDetailsPage.class);

        form.add(ok);
        form.add(cancel);

        addControl(form);
View Full Code Here

TOP

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

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.