Package com.ponysdk.ui.server.form2

Examples of com.ponysdk.ui.server.form2.FormFieldComponent


        listBox.addItem("Item 3");
        listBox.addItem("Item 4");
        listBox.addItem("Item 5");
        listBox.addItem("Item 6");

        final FormField<String> field6 = new StringListBoxFormField(listBox);
        field6.setValidator(new NotEmptyFieldValidator());

        final FormField<Date> field7 = new DateBoxFormField();
        field7.setValidator(new NotEmptyFieldValidator());

        final FormField<Date> field8 = new DateBoxFormField();
View Full Code Here


                return new PLabel();
            }
        });

        final DataGridColumnDescriptor<Pony, String> nameColumnDescriptor = new DataGridColumnDescriptor<Pony, String>();
        final ComplexHeaderCellRenderer nameHeaderCellRender = new FilterableHeaderCellRenderer("Name", new StringTextBoxFormField(), "name");
        nameHeaderCellRender.addFilterListener(dataProvider);
        nameColumnDescriptor.setHeaderCellRenderer(nameHeaderCellRender);
        nameColumnDescriptor.setValueProvider(new BeanValueProvider<Pony, String>("name"));
        nameColumnDescriptor.setCellRenderer(new LabelCellRenderer<String>());
        nameColumnDescriptor.setSubCellRenderer(new LabelCellRenderer<String>());

        nameColumnDescriptor.setSubCellRenderer(new LabelCellRenderer<String>());

        final PListBox ageListBox = new PListBox(true);
        for (int i = 0; i < 30; i++)
            ageListBox.addItem(i + " year", i);

        final DataGridColumnDescriptor<Pony, String> ageColumnDescriptor = new DataGridColumnDescriptor<Pony, String>();
        ageColumnDescriptor.setValueProvider(new BeanValueProvider<Pony, String>("age"));
        final ComplexHeaderCellRenderer ageHeaderCellRender = new ComplexHeaderCellRenderer("Age", new ListBoxFormField<Integer>(ageListBox), "age");
        ageHeaderCellRender.addFilterListener(dataProvider);
        ageColumnDescriptor.setHeaderCellRenderer(ageHeaderCellRender);
        ageColumnDescriptor.setCellRenderer(new LabelCellRenderer<String>());
        ageColumnDescriptor.setSubCellRenderer(new LabelCellRenderer<String>());

        final DataGridColumnDescriptor<Pony, String> raceColumnDescriptor = new DataGridColumnDescriptor<Pony, String>();
        raceColumnDescriptor.setValueProvider(new BeanValueProvider<Pony, String>("race"));
        final ComplexHeaderCellRenderer raceHeaderCellRender = new ComplexHeaderCellRenderer("Race", new StringTextBoxFormField(), "race");
        raceHeaderCellRender.addFilterListener(dataProvider);
        raceColumnDescriptor.setHeaderCellRenderer(raceHeaderCellRender);
        raceColumnDescriptor.setCellRenderer(new LabelCellRenderer<String>());
        raceColumnDescriptor.setSubCellRenderer(new LabelCellRenderer<String>());
View Full Code Here

    }

    private void buildCreatePonyActivity() {

        createPony = new Form();
        nameFormField = new StringTextBoxFormField();
        ageFormField = new IntegerTextBoxFormField();
        raceFormField = new StringTextBoxFormField();

        nameFormField.setValidator(new NotEmptyFieldValidator());
        raceFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new IntegerFieldValidator());
View Full Code Here

        }

    }

    private ColorFormField buildColorFormField(final String defaultValue, final PSimplePanel preview) {
        final StringTextBoxFormField ff = new StringTextBoxFormField();
        ff.setValidator(colorValidator);
        ff.setValue(defaultValue);
        ff.getTextBox().addValueChangeHandler(new PValueChangeHandler<String>() {

            @Override
            public void onValueChange(final PValueChangeEvent<String> event) {
                if (colorValidator.isValid(event.getValue()).isValid()) {
                    preview.setStyleProperty("backgroundColor", "#" + event.getValue());
View Full Code Here

        final PFlexTable panel = new PFlexTable();

        final Form form = new Form();

        final FormField<String> field1 = new StringTextBoxFormField();
        field1.setValidator(new NotEmptyFieldValidator());
        final FormField<String> field2 = new StringTextBoxFormField();
        field2.setValidator(new DoubleFieldValidator());
        final FormField<String> field3 = new StringTextBoxFormField();
        field3.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new DoubleFieldValidator()));
        final FormField<String> field4 = new StringTextBoxFormField();
        field4.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new EmailFieldValidator()));
        final FormField<Boolean> field5 = new CheckBoxFormField();
        field5.setValidator(new UncheckedFieldValidator());

        final PListBox listBox = new PListBox(true);
        listBox.addItem("Item 1");
        listBox.addItem("Item 2");
        listBox.addItem("Item 3");
        listBox.addItem("Item 4");
        listBox.addItem("Item 5");
        listBox.addItem("Item 6");

        final FormField<String> field6 = new StringListBoxFormField(listBox);
        field6.setValidator(new NotEmptyFieldValidator());

        final FormField<Date> field7 = new DateBoxFormField();
        field7.setValidator(new NotEmptyFieldValidator());

        final FormField<Date> field8 = new DateBoxFormField();
        field7.setValidator(new NotEmptyFieldValidator());

        final FormField<String> field9 = new StringTextBoxFormField();
        field9.setValidator(new NotEmptyFieldValidator());

        final FormField<String> field10 = new StringTextBoxFormField();
        field10.setValidator(new TwinFieldValidator("Field doesn't match", field9));

        form.addFormField(field1);
        form.addFormField(field2);
        form.addFormField(field3);
        form.addFormField(field4);
View Full Code Here

        final FormField<String> field1 = new StringTextBoxFormField();
        field1.setValidator(new NotEmptyFieldValidator());
        final FormField<String> field2 = new StringTextBoxFormField();
        field2.setValidator(new DoubleFieldValidator());
        final FormField<String> field3 = new StringTextBoxFormField();
        field3.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new DoubleFieldValidator()));
        final FormField<String> field4 = new StringTextBoxFormField();
        field4.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new EmailFieldValidator()));
        final FormField<Boolean> field5 = new CheckBoxFormField();
        field5.setValidator(new UncheckedFieldValidator());

        final PListBox listBox = new PListBox(true);
        listBox.addItem("Item 1");
View Full Code Here

        final Form form = new Form();

        final FormField<String> field1 = new StringTextBoxFormField();
        field1.setValidator(new NotEmptyFieldValidator());
        final FormField<String> field2 = new StringTextBoxFormField();
        field2.setValidator(new DoubleFieldValidator());
        final FormField<String> field3 = new StringTextBoxFormField();
        field3.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new DoubleFieldValidator()));
        final FormField<String> field4 = new StringTextBoxFormField();
        field4.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new EmailFieldValidator()));
        final FormField<Boolean> field5 = new CheckBoxFormField();
        field5.setValidator(new UncheckedFieldValidator());
View Full Code Here

        final FormField<String> field2 = new StringTextBoxFormField();
        field2.setValidator(new DoubleFieldValidator());
        final FormField<String> field3 = new StringTextBoxFormField();
        field3.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new DoubleFieldValidator()));
        final FormField<String> field4 = new StringTextBoxFormField();
        field4.setValidator(new CompositeFieldValidator(new NotEmptyFieldValidator(), new EmailFieldValidator()));
        final FormField<Boolean> field5 = new CheckBoxFormField();
        field5.setValidator(new UncheckedFieldValidator());

        final PListBox listBox = new PListBox(true);
        listBox.addItem("Item 1");
View Full Code Here

        raceFormField = new StringTextBoxFormField();

        nameFormField.setValidator(new NotEmptyFieldValidator());
        raceFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new IntegerFieldValidator());

        createPony.addFormField(nameFormField);
        createPony.addFormField(raceFormField);
        createPony.addFormField(ageFormField);
View Full Code Here

        createPony = new Form();
        nameFormField = new StringTextBoxFormField();
        ageFormField = new IntegerTextBoxFormField();
        raceFormField = new StringTextBoxFormField();

        nameFormField.setValidator(new NotEmptyFieldValidator());
        raceFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new NotEmptyFieldValidator());
        ageFormField.setValidator(new IntegerFieldValidator());

        createPony.addFormField(nameFormField);
        createPony.addFormField(raceFormField);
        createPony.addFormField(ageFormField);
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.form2.FormFieldComponent

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.