Package org.apache.click.control

Examples of org.apache.click.control.TextField


        postCodeLookupWrapper.add(postCodeLookup);
        postCodeLookupWrapper.setStyle("text-align", "right");

        getForm().add(postCodeLookupWrapper);

        getForm().add(new TextField("address.line1", "Line One"));
        getForm().add(new TextField("address.line2", "Line Two"));
        getForm().add(new TextField("address.suburb", "Suburb"));

        stateSelect = new QuerySelect("address.state", "State", true);

        stateSelect.setQueryValueLabel("states", "value", "label");
        getForm().add(stateSelect);
View Full Code Here


    public AdvancedForm() {
        FieldSet fieldSet = new FieldSet("Customer");
        form.add(fieldSet);

        TextField nameField = new TextField("name", true);
        nameField.setMinLength(5);
        nameField.setFocus(true);
        fieldSet.add(nameField);

        fieldSet.add(new EmailField("email", true));

        fieldSet.add(investmentSelect);
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

    public String msg;

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

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

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

        VerticalFieldSet fieldset = new VerticalFieldSet("contactDetails");
        fieldset.setLegend("Contact Details");

        fieldset.add(new TitleSelect("title"));
        fieldset.add(new TextField("firstName")).setRequired(true);
        fieldset.add(new TextField("middleNames"));
        fieldset.add(new TextField("lastName")).setRequired(true);
        fieldset.add(new TextField("contactNumber"));
        fieldset.add(new EmailField("email"));

        form.add(fieldset);

        fieldset = new VerticalFieldSet("paymentDetails");
        fieldset.setLegend("Payment Details");

        RadioGroup paymentGroup = new RadioGroup("paymentOption");
        paymentGroup.add(new Radio("cod", "Cash On Delivery "));
        paymentGroup.add(new Radio("credit", "Credit Card "));
        paymentGroup.setVerticalLayout(false);
        fieldset.add(paymentGroup);

        // Retrieve the paymentGroup's ListItem, and set its CSS class to "radio"
        ListItem item = (ListItem) fieldset.getHtmlList().getLast();
        item.setAttribute("class", "radio");

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

        form.add(fieldset);
View Full Code Here

                }

                int maxlength = dbAttribute.getMaxLength();
                if (maxlength != -1) {
                    if (field instanceof TextField) {
                        TextField textField = (TextField) field;
                        if (textField.getMaxLength() == 0) {
                            textField.setMaxLength(maxlength);
                        }
                    } else if (field instanceof TextArea) {
                        TextArea textArea = (TextArea) field;
                        if (textArea.getMaxLength() == 0) {
                            textArea.setMaxLength(maxlength);
View Full Code Here

        QuerySelect querySelect = new QuerySelect("title", true);
        querySelect.setQueryValueLabel("titles", "value", "label");
        clientFieldSet.add(querySelect);

        clientFieldSet.add(new TextField("firstName"));
        clientFieldSet.add(new TextField("lastName"));
        clientFieldSet.add(new DateField("dateJoined"));
        clientFieldSet.add(new EmailField("email"));

        FieldSet addressFieldSet = new FieldSet("Address");
        form.add(addressFieldSet);

        addressFieldSet.add(new TextField("address.line1", "Line One"));
        addressFieldSet.add(new TextField("address.line2", "Line Two"));
        addressFieldSet.add(new TextField("address.suburb", "Suburb"));

        querySelect = new QuerySelect("address.state", "State", true);
        querySelect.setQueryValueLabel("states", "value", "label");
        addressFieldSet.add(querySelect);
View Full Code Here

        QuerySelect querySelect = new QuerySelect("title", true);
        querySelect.setQueryValueLabel("titles", "value", "label");
        clientFieldSet.add(querySelect);

        clientFieldSet.add(new TextField("firstName"));
        clientFieldSet.add(new TextField("lastName"));
        clientFieldSet.add(new DateField("dateJoined"));
        clientFieldSet.add(new EmailField("email"));

        FieldSet addressFieldSet = new FieldSet("Address");
        ((TabbedCayenneForm)form).addTabSheet(addressFieldSet);

        addressFieldSet.add(new TextField("address.line1", "Line One"));
        addressFieldSet.add(new TextField("address.line2", "Line Two"));
        addressFieldSet.add(new TextField("address.suburb", "Suburb"));

        querySelect = new QuerySelect("address.state", "State", true);
        querySelect.setQueryValueLabel("states", "value", "label");
        addressFieldSet.add(querySelect);
View Full Code Here

        // Delivery fieldset

        FieldSet deliveryFieldSet = new FieldSet("deliveryDetails");
        form.add(deliveryFieldSet);

        TextField addressToField = new TextField("addressedTo", true);
        addressToField.setSize(30);
        deliveryFieldSet.add(addressToField);

        TextArea textArea = new TextArea("deliveryAddress", true);
        textArea.setCols(30);
        textArea.setRows(3);
        deliveryFieldSet.add(textArea);

        DateField dateField = new DateField("deliveryDate");
        deliveryFieldSet.add(dateField);

        PackagingRadioGroup radioGroup = new PackagingRadioGroup("packaging");
        radioGroup.setValue("STD");
        radioGroup.setVerticalLayout(true);
        deliveryFieldSet.add(radioGroup);

        deliveryFieldSet.add(new Checkbox("telephoneOnDelivery"));

        // Payment fieldset

        FieldSet paymentFieldSet = new FieldSet("paymentDetails");
        form.add(paymentFieldSet);

        paymentFieldSet.add(new TextField("cardName"));
        paymentFieldSet.add(new CreditCardField("cardNumber"));
        IntegerField expiryField = new IntegerField("expiry");
        expiryField.setSize(4);
        expiryField.setMaxLength(4);
        paymentFieldSet.add(expiryField);
View Full Code Here

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

    public EditFormTablePage() {
        // Setup customers form
        FieldSet fieldSet = new FieldSet("customer");
        fieldSet.add(new TextField("name")).setRequired(true);
        fieldSet.add(new EmailField("email")).setRequired(true);
        fieldSet.add(new InvestmentSelect("investments")).setRequired(true);
        fieldSet.add(new DoubleField("holdings"));
        DateField dateJoined = new DateField("dateJoined");
        dateJoined.setDate(new Date());
        fieldSet.add(dateJoined);
        customerForm.add(fieldSet);
        customerForm.add(new Submit("add", "Add Customer", this, "onAddClick"));

        // * #2. Create the FormTable and pass in the existing Form into the
        // constructor. FormTable now knows it should not create an internal
        // Form instance.
        table = new FormTable("table", form);

        // Assemble the FormTable columns
        table.setClass(Table.CLASS_SIMPLE);
        table.setWidth("700px");
        table.setPageSize(5);
        table.setShowBanner(true);

        table.addColumn(new Column("id"));

        FieldColumn column = new FieldColumn("name", new TextField());
        column.setVerticalAlign("baseline");
        table.addColumn(column);

        column = new FieldColumn("email", new EmailField());
        column.getField().setRequired(true);
View Full Code Here

TOP

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

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.