Examples of FieldGroup


Examples of com.vaadin.data.fieldgroup.FieldGroup

        Window modal = new Window("Add event");
        modal.setModal(true);
        modal.setResizable(false);
        modal.setDraggable(false);
        modal.setWidth("300px");
        final FieldGroup fieldGroup = new FieldGroup();

        FormLayout formLayout = new FormLayout();
        TextField captionField = new TextField("Caption");
        captionField.setImmediate(true);
        TextField descriptionField = new TextField("Description");
        descriptionField.setImmediate(true);
        DateField startField = new DateField("Start");
        startField.setResolution(Resolution.MINUTE);
        startField.setImmediate(true);
        DateField endField = new DateField("End");
        endField.setImmediate(true);
        endField.setResolution(Resolution.MINUTE);

        formLayout.addComponent(captionField);
        formLayout.addComponent(descriptionField);
        formLayout.addComponent(startField);
        formLayout.addComponent(endField);

        fieldGroup.bind(captionField, ContainerEventProvider.CAPTION_PROPERTY);
        fieldGroup.bind(descriptionField,
                ContainerEventProvider.DESCRIPTION_PROPERTY);
        fieldGroup.bind(startField, ContainerEventProvider.STARTDATE_PROPERTY);
        fieldGroup.bind(endField, ContainerEventProvider.ENDDATE_PROPERTY);

        fieldGroup.setItemDataSource(new BeanItem<BasicEvent>(event, Arrays
                .asList(ContainerEventProvider.CAPTION_PROPERTY,
                        ContainerEventProvider.DESCRIPTION_PROPERTY,
                        ContainerEventProvider.STARTDATE_PROPERTY,
                        ContainerEventProvider.ENDDATE_PROPERTY)));
        modal.setContent(formLayout);
        modal.addCloseListener(new Window.CloseListener() {
            @Override
            public void windowClose(CloseEvent e) {
                // Commit changes to bean
                try {
                    fieldGroup.commit();
                } catch (CommitException e1) {
                    e1.printStackTrace();
                }

                if (events.containsId(event)) {
View Full Code Here

Examples of com.vaadin.data.fieldgroup.FieldGroup

        this.parent = parent;
        setSpacing(true);
        setWidth("100%");

        VerticalLayout vl = new VerticalLayout();
        FieldGroup fg = new BeanFieldGroup<Person>(Person.class);
        fg.setItemDataSource(new BeanItem<Person>(new Person()));
        for (Object propId : fg.getUnboundPropertyIds()) {
            if (!"address".equals(propId)) {
                vl.addComponent(fg.buildAndBind(propId));
            }
        }

        addComponent(vl);
View Full Code Here

Examples of org.broadleafcommerce.cms.field.domain.FieldGroup

                scDTO.getValues().put(fieldKey, fldValue);
            } else {
                FieldDefinition definition = null;
                Iterator<FieldGroup> groupIterator = sc.getStructuredContentType().getStructuredContentFieldTemplate().getFieldGroups().iterator();
                while (groupIterator.hasNext() && definition == null) {
                    FieldGroup group = groupIterator.next();
                    for (FieldDefinition def : group.getFieldDefinitions()) {
                        if (def.getName().equals(fieldKey)) {
                            definition = def;
                            break;
                        }
                    }
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.layout.simple.FieldGroup

                new ShortTextField("address.city", "City"),
                new ShortTextField("address.country", "Country")
        );

        SimpleFormLayout layout = new SimpleFormLayout();
        layout.addGroup(new FieldGroup("Contact Details").setOptional(true).setKeys(
                "address.street", "address.city", "address.country"
        ));

        final FormPanel formPanel = new FormPanel(form, layout);
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.renderer.simple.FieldGroup

        bodyField.setValidators(notNull(), notEmpty());
       
        final Form form = new Form();
        form.addFields(toField, subjectField, bodyField);

        FieldGroup group = new FieldGroup("to", "subject", "body");
        group.setHints(editorWidth("100%"));
        group.setHints("body", editorHeight("200px"));

        SimpleFieldsRenderer render = new SimpleFieldsRenderer();
        render.addFieldGroup(group);
        render.setLineGap(10);
        render.setHints(labelWidth("50px"));
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.renderer.simple.FieldGroup

        cityField.setValidators(notNull());

        final Form form = new Form();
        form.addFields(firstNameField, lastNameField, emailField, street1Field, street2Field, cityField);

        FieldGroup generalGroup = new FieldGroup("firstName", "lastName", "email");
//        generalGroup.setLayoutHints(new LayoutHints().setEditorWidth("100%"));

        FieldGroup addressGroup = new FieldGroup("Address", new String[]{"street1", "street2", "city"});
        addressGroup.setHints(editorWidth("100%"));
        addressGroup.setHints("street2", labelVisible(false));

        SimpleFieldsRenderer renderer = new SimpleFieldsRenderer();
        renderer.setHints(labelWidth("65px"));
        renderer.addFieldGroup(generalGroup);
        renderer.addFieldGroup(addressGroup);
View Full Code Here

Examples of org.gwtoolbox.widget.client.table.datagrid.FieldGroup

        addGap(main, "20px");

        SimpleButton groupButton = new SimpleButton("Group By Gender");
        groupButton.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                FieldGroup group = new FieldGroup("Gender", "gender");
                group.setShowCounts(true);
                grid.setGroupBy(group);
            }
        });
        SimpleButton clearGroupingButton = new SimpleButton("Clear Grouping");
        clearGroupingButton.addClickListener(new ClickListener() {
View Full Code Here

Examples of org.gwtoolbox.widget.client.table.datagrid.FieldGroup

                    if (sortable) {
                        menu.addSeparator();
                    }
                    menu.addItem("Group By This Field", new Command() {
                        public void execute() {
                            FieldGroup group = new FieldGroup(getName(), fieldName, new ComparableComparator());
                            grid.setGroupBy(group);
                        }
                    });
                }
            }
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.