Package com.smartgwt.client.widgets.form.fields

Examples of com.smartgwt.client.widgets.form.fields.FormItem


        }
    }

    private void refresh() {
        if (this.jobTrigger != null) {
            FormItem modeItem = this.modeForm.getItem(FIELD_MODE);
            if (this.jobTrigger.getRecurrenceType() == JobTrigger.RecurrenceType.CRON_EXPRESSION) {
                modeItem.setValue("cron");
                changeMode("cron");
                this.cronForm.setValue("cronExpression", this.jobTrigger.getCronExpression());
            } else {
                modeItem.setValue("calendar");
                this.calendarTypeForm.hide();
                changeMode("calendar");

                FormItem startTypeItem = this.laterForm.getItem(FIELD_START_TYPE);
                startTypeItem.setValue("on");
                DurationItem startDelayItem = (DurationItem) this.laterForm.getItem(FIELD_START_DELAY);
                FormItem startTimeItem = this.laterForm.getField(FIELD_START_TIME);
                changeStartType("on", startDelayItem, startTimeItem);
                startTimeItem.setValue(this.jobTrigger.getStartDate());

                FormItem calendarTypeItem = this.calendarTypeForm.getField("calendarType");
                if (this.jobTrigger.getRecurrenceType() == JobTrigger.RecurrenceType.REPEAT_INTERVAL) {
                    calendarTypeItem.setValue("laterAndRepeat");
                    changeCalendarType("laterAndRepeat");

                    DurationItem repeatIntervalItem = (DurationItem) this.repeatForm.getItem(FIELD_REPEAT_INTERVAL);
                    repeatIntervalItem.setAndFormatValue(this.jobTrigger.getRepeatInterval());

                    FormItem endTimeItem = this.repeatForm.getField(FIELD_END_TIME);
                    DurationItem repeatDurationItem = (DurationItem) this.repeatForm.getItem(FIELD_REPEAT_DURATION);
                    FormItem recurrenceTypeItem = this.repeatForm.getField(FIELD_RECURRENCE_TYPE);
                    if (this.jobTrigger.getRepeatCount() != null) {
                        recurrenceTypeItem.setValue("for");
                        changeRecurrenceType("for", endTimeItem, repeatDurationItem);
                        repeatDurationItem.setValue(this.jobTrigger.getRepeatCount(), UnitType.ITERATIONS);
                    } else if (this.jobTrigger.getEndDate() != null) {
                        recurrenceTypeItem.setValue("until");
                        changeRecurrenceType("until", endTimeItem, repeatDurationItem);
                        endTimeItem.setValue(this.jobTrigger.getEndDate());
                    } else {
                        recurrenceTypeItem.setValue("indefinitely");
                        changeRecurrenceType("indefinitely", endTimeItem, repeatDurationItem);
                    }
                } else {
                    calendarTypeItem.setValue("later");
                    changeCalendarType("later");
View Full Code Here


            this.isRecurring = false;
        } else if (calendarType.equals("nowAndRepeat")) {
            this.isStartLater = false;
            this.isRecurring = true;

            FormItem repeatIntervalItem = repeatForm.getItem(FIELD_REPEAT_INTERVAL);
            repeatIntervalItem.setTitle(MSG.widget_jobTriggerEditor_field_repeatInterval_now());
            repeatIntervalItem.redraw();
        } else if (calendarType.equals("later")) {
            this.isStartLater = true;
            this.isRecurring = false;
        } else {
            // value.equals("laterAndRepeat")
            this.isStartLater = true;
            this.isRecurring = true;

            FormItem repeatIntervalItem = repeatForm.getItem(FIELD_REPEAT_INTERVAL);
            repeatIntervalItem.setTitle(MSG.widget_jobTriggerEditor_field_repeatInterval_later());
            repeatIntervalItem.redraw();
        }
        if (isStartLater) {
            laterForm.show();
        } else {
            laterForm.hide();
View Full Code Here

    @Override
    protected List<FormItem> createFormItems(EnhancedDynamicForm form) {
        List<FormItem> items = new ArrayList<FormItem>();

        // Username field should be editable when creating a new user, but should be read-only for existing users.
        FormItem nameItem;
        if (isNewRecord()) {
            nameItem = new TextItem(UsersDataSource.Field.NAME);
        } else {
            nameItem = new StaticTextItem(UsersDataSource.Field.NAME);
            ((StaticTextItem) nameItem).setEscapeHTML(true);
        }
        items.add(nameItem);

        StaticTextItem isLdapItem = new StaticTextItem(UsersDataSource.Field.LDAP);
        items.add(isLdapItem);
        boolean isLdapAuthenticatedUser = Boolean.valueOf(form.getValueAsString(UsersDataSource.Field.LDAP));

        // Only display the password fields for non-LDAP users (i.e. users that have an associated RHQ Principal).
        if (!this.isReadOnly() && !isLdapAuthenticatedUser) {
            PasswordItem passwordItem = new PasswordItem(UsersDataSource.Field.PASSWORD);
            passwordItem.setShowTitle(true);
            items.add(passwordItem);

            final PasswordItem verifyPasswordItem = new PasswordItem(UsersDataSource.Field.PASSWORD_VERIFY);
            verifyPasswordItem.setShowTitle(true);
            final boolean[] initialPasswordChange = { true };
            passwordItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    if (initialPasswordChange[0]) {
                        verifyPasswordItem.clearValue();
                        initialPasswordChange[0] = false;
                    }
                }
            });
            items.add(verifyPasswordItem);
        }

        TextItem firstNameItem = new TextItem(UsersDataSource.Field.FIRST_NAME);
        firstNameItem.setShowTitle(true);
        firstNameItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(firstNameItem);

        TextItem lastNameItem = new TextItem(UsersDataSource.Field.LAST_NAME);
        lastNameItem.setShowTitle(true);
        lastNameItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(lastNameItem);

        TextItem emailAddressItem = new TextItem(UsersDataSource.Field.EMAIL_ADDRESS);
        emailAddressItem.setShowTitle(true);
        emailAddressItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(emailAddressItem);

        TextItem phoneNumberItem = new TextItem(UsersDataSource.Field.PHONE_NUMBER);
        phoneNumberItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(phoneNumberItem);

        TextItem departmentItem = new TextItem(UsersDataSource.Field.DEPARTMENT);
        departmentItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(departmentItem);

        boolean userBeingEditedIsRhqadmin = (getRecordId() == SUBJECT_ID_RHQADMIN);
        FormItem activeItem;
        if (!this.loggedInUserHasManageSecurityPermission || userBeingEditedIsRhqadmin) {
            activeItem = new StaticTextItem(UsersDataSource.Field.FACTIVE);
        } else {
            RadioGroupItem activeRadioGroupItem = new RadioGroupItem(UsersDataSource.Field.FACTIVE);
            activeRadioGroupItem.setVertical(false);
View Full Code Here

        nameItem.setValue("<b>" + title + "</b>");
        nameItem.setShowTitle(false);
        nameItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
        fields.add(nameItem);

        FormItem valueItem = null;
        if (unitsDropdown) {
            valueItem = buildJVMMemoryItem(name, value);
        } else {
            valueItem = new TextItem();
            valueItem.setName(name);
            valueItem.setValue(value);
            valueItem.setWidth(220);
            if (validator != null) {
                valueItem.setValidators(validator);
            }
        }
        valueItem.setValidateOnChange(true);
        valueItem.setAlign(Alignment.CENTER);
        valueItem.setShowTitle(false);
        valueItem.setRequired(true);
        valueItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
        fields.add(valueItem);

        StaticTextItem descriptionItem = new StaticTextItem();
        descriptionItem.setValue(description);
        descriptionItem.setShowTitle(false);
View Full Code Here

            staticItem.setShowTitle(false);
            staticItem.setTooltip(MSG.view_groupConfigEdit_tooltip_1());
            Boolean isHomogeneous = isHomogeneous(propertySimple);
            staticItem.setVisible(!isHomogeneous);

            FormItem valueItem = fields.get(2);
            FormItemIcon icon = buildEditMemberValuesIcon(propertyDefinitionSimple, propertySimple, valueItem);
            staticItem.setIcons(icon);

            valueItem.setAttribute(RHQ_STATIC_ITEM_NAME_ATTRIBUTE, staticItem.getName());
            fields.add(3, staticItem);
        }

        return fields;
    }
View Full Code Here

    }

    @Override
    protected FormItem buildSimpleField(final PropertyDefinitionSimple propertyDefinitionSimple,
        final PropertySimple propertySimple) {
        final FormItem item = super.buildSimpleField(propertyDefinitionSimple, propertySimple);

        boolean isAggregate = isAggregateProperty(propertySimple);
        if (isAggregate) {
            // Add the icon that user can click to edit the member values.
            FormItemIcon icon = buildEditMemberValuesIcon(propertyDefinitionSimple, propertySimple, item);

            item.setIcons(icon);

            item.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent changedEvent) {
                    Object value = changedEvent.getValue();
                    updateMemberProperties(propertySimple, value);
                }
            });

            Boolean isHomogeneous = isHomogeneous(propertySimple);
            item.setVisible(isHomogeneous);
        }

        return item;
    }
View Full Code Here

    }

    @Override
    protected FormItem buildUnsetItem(final PropertyDefinitionSimple propertyDefinitionSimple,
        final PropertySimple propertySimple, final FormItem valueItem) {
        final FormItem unsetItem = super.buildUnsetItem(propertyDefinitionSimple, propertySimple, valueItem);
        if (unsetItem instanceof CheckboxItem && !isHomogeneous(propertySimple) && isAggregateProperty(propertySimple)) {
            // non-homogeneous aggregate property (i.e. members have mixed values)
            unsetItem.setValue(false);
            unsetItem.setDisabled(true);
        }
        valueItem.setAttribute(RHQ_UNSET_ITEM_NAME_ATTRIBUTE, unsetItem.getName());
        return unsetItem;
    }
View Full Code Here

        memberField.setCanEdit(false);

        final ListGridField valueField = new ListGridField(FIELD_VALUE, MSG.common_title_value());
        valueField.setRequired(propertyDefinitionSimple.isRequired());
        valueField.setCanEdit(true);
        final FormItem editorItem = buildEditorFormItem(valueField, propertyDefinitionSimple);
        valueField.setEditorType(editorItem);
        valueField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                if (value == null) {
                    return "";
                }
                List<PropertyDefinitionEnumeration> enumeratedValues = propertyDefinitionSimple.getEnumeratedValues();
                if (enumeratedValues != null && !enumeratedValues.isEmpty()) {
                    for (PropertyDefinitionEnumeration option : enumeratedValues) {
                        if (option.getValue().equals(value.toString())) {
                            return option.getName();
                        }
                    }
                    return value.toString();
                } else {
                    switch (propertyDefinitionSimple.getType()) {
                    case BOOLEAN: {
                        return BOOLEAN_PROPERTY_ITEM_VALUE_MAP.get(value.toString());
                    }
                    case PASSWORD: {
                        return "******";
                    }
                    default:
                        return value.toString();
                    }
                }
            }
        });

        ListGridField unsetField = new ListGridField(FIELD_UNSET, MSG.view_groupConfigEdit_unset());
        unsetField.setType(ListGridFieldType.BOOLEAN);
        if (propertyDefinitionSimple.isRequired()) {
            unsetField.setHidden(true);
            unsetField.setCanEdit(false);
        } else {
            unsetField.setHidden(false);
            unsetField.setCanEdit(true);
            unsetField.setCanToggle(false); // otherwise, our handler won't get the form

            // add handler to handle when the user flips the unset bit
            unsetField.addChangedHandler(new com.smartgwt.client.widgets.grid.events.ChangedHandler() {
                public void onChanged(com.smartgwt.client.widgets.grid.events.ChangedEvent event) {
                    Boolean isUnset = (Boolean) event.getValue();
                    FormItem valueItem = event.getForm().getField(FIELD_VALUE);
                    if (isUnset) {
                        int rowNum = event.getRowNum();
                        memberValuesGrid.setEditValue(rowNum, FIELD_VALUE, (String) null);
                    } else {
                        valueItem.focusInItem();
                    }
                    valueItem.redraw();
                }
            });

            // add handler when user clears the value field - this should turn on the "unset" button
            valueField.addChangeHandler(new com.smartgwt.client.widgets.grid.events.ChangeHandler() {
                public void onChange(com.smartgwt.client.widgets.grid.events.ChangeEvent event) {
                    int rowNum = event.getRowNum();
                    if (event.getValue() == null || event.getValue().toString().length() == 0) {
                        memberValuesGrid.setEditValue(rowNum, FIELD_UNSET, true);
                    } else {
                        memberValuesGrid.setEditValue(rowNum, FIELD_UNSET, false);
                    }
                }
            });
        }

        idField.setWidth("75");
        memberField.setWidth("*");
        unsetField.setWidth("50");
        valueField.setWidth("45%");
        memberValuesGrid.setFields(idField, memberField, unsetField, valueField);
        layout.addMember(memberValuesGrid);

        // create the footer strip - will contain ok and cancel buttons
        EnhancedToolStrip footerStrip = new EnhancedToolStrip();
        footerStrip.setWidth100();
        footerStrip.setPadding(5);
        footerStrip.setMembersMargin(10);
        layout.addMember(footerStrip);

        // footer OK button
        final IButton okButton = new EnhancedIButton(MSG.common_button_ok(), ButtonColor.BLUE);
        if (!propertyIsReadOnly) {
            // if its read-only, allow the ok button to be enabled to just let the user close the window
            // otherwise, disable it now and we will enable it after we know things are ready to be saved
            okButton.setDisabled(true);
        }
        okButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (!propertyIsReadOnly) {
                    boolean valuesHomogeneous = true;
                    boolean isValid = true;

                    String firstValue = data[0].getAttribute(FIELD_VALUE);
                    int i = 0;
                    for (ListGridRecord valueItem : data) {
                        String value = valueItem.getAttribute(FIELD_VALUE);
                        if (valuesHomogeneous) {
                            if ((value != null && !value.equals(firstValue)) || (value == null && firstValue != null)) {
                                valuesHomogeneous = false;
                            }
                        }
                        isValid = isValid && memberValuesGrid.validateRow(i);
                        Configuration config = (Configuration) valueItem.getAttributeAsObject(ATTR_CONFIG_OBJ);

                        PropertySimple memberPropertySimple = (PropertySimple) getProperty(config,
                            aggregatePropertySimple, index);
                        memberPropertySimple.setValue(value);
                        memberPropertySimple.setErrorMessage(null);
                    }

                    String aggregateStaticItemName = aggregateValueItem.getAttribute(RHQ_STATIC_ITEM_NAME_ATTRIBUTE);
                    FormItem aggregateStaticItem = aggregateValueItem.getForm().getField(aggregateStaticItemName);

                    String aggregateUnsetItemName = aggregateValueItem.getAttribute(RHQ_UNSET_ITEM_NAME_ATTRIBUTE);
                    FormItem aggregateUnsetItem = aggregateValueItem.getForm().getField(aggregateUnsetItemName);
                    aggregateUnsetItem.setDisabled(!valuesHomogeneous);

                    if (valuesHomogeneous) {
                        // Update the value of the aggregate property and set its override flag to true.
                        aggregatePropertySimple.setValue(firstValue);
                        aggregatePropertySimple.setOverride(true);

                        boolean isUnset = (firstValue == null);
                        aggregateUnsetItem.setValue(isUnset);

                        // Set the aggregate value item's value to the homogeneous value, unhide it, and enable it
                        // unless it's unset.
                        setValue(aggregateValueItem, firstValue);
                        aggregateValueItem.show();
                        aggregateValueItem.setDisabled(isUnset);

                        aggregateStaticItem.hide();
                    } else {
                        aggregatePropertySimple.setValue(null);
                        aggregatePropertySimple.setOverride(false);

                        aggregateValueItem.hide();

                        aggregateStaticItem.show();
                    }

                    CoreGUI.getMessageCenter().notify(
                        new Message(MSG.view_groupConfigEdit_saveReminder(), Severity.Info));

                    // this has the potential to send another message to the message center
                    firePropertyChangedEvent(aggregatePropertySimple, propertyDefinitionSimple, isValid);
                }

                popup.destroy();
            }
        });
        footerStrip.addMember(okButton);

        // track errors in grid - enable/disable OK button accordingly
        // I tried many ways to get this to work right - this is what I came up with
        memberValuesGrid.addRowEditorExitHandler(new RowEditorExitHandler() {
            public void onRowEditorExit(RowEditorExitEvent event) {
                memberValuesGrid.validateRow(event.getRowNum());
                if (memberValuesGrid.hasErrors()) {
                    okButton.disable();
                } else {
                    okButton.enable();
                }
            }
        });

        // if the data can be changed, add some additional widgets; if not, make the value grid read only
        if (propertyIsReadOnly) {
            memberValuesGrid.setCanEdit(false);
        } else {
            // put a cancel button in the footer strip to allow the user to exit without saving changes
            final IButton cancelButton = new EnhancedIButton(MSG.common_button_cancel());
            cancelButton.focus();
            cancelButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    popup.destroy();
                }
            });
            footerStrip.addMember(cancelButton);

            // create a small form in the header strip to allow the user to apply a value to ALL rows
            final DynamicForm setAllForm = new DynamicForm();
            setAllForm.setNumCols(3);
            setAllForm.setCellPadding(5);
            setAllForm.setColWidths("20%", 50, "*"); // button, unset, value

            // the "set all" value field
            PropertySimple masterPropertySimple = new PropertySimple(propertyDefinitionSimple.getName(), null);
            final FormItem masterValueItem = super.buildSimpleField(propertyDefinitionSimple, masterPropertySimple);
            masterValueItem.setName(MEMBER_VALUES_EDITOR_FIELD_PREFIX + masterValueItem.getName());
            masterValueItem.setValidateOnChange(true);
            masterValueItem.setDisabled(false);
            masterValueItem.setAlign(Alignment.LEFT);
            masterValueItem.setStartRow(false);
            masterValueItem.setEndRow(true);

            // the "set all" unset field
            FormItem masterUnsetItem;
            if (!propertyDefinitionSimple.isRequired()) {
                final CheckboxItem unsetItem = new CheckboxItem(MEMBER_VALUES_EDITOR_FIELD_PREFIX + "unsetall");
                boolean unset = (masterPropertySimple == null || masterPropertySimple.getStringValue() == null);
                unsetItem.setValue(unset);
                unsetItem.setDisabled(isReadOnly(propertyDefinitionSimple, masterPropertySimple));
                unsetItem.setShowLabel(false);
                unsetItem.setLabelAsTitle(false);

                unsetItem.addChangedHandler(new ChangedHandler() {
                    public void onChanged(ChangedEvent changedEvent) {
                        Boolean isUnset = (Boolean) changedEvent.getValue();
                        masterValueItem.setDisabled(isUnset);
                        if (isUnset) {
                            setValue(masterValueItem, null);
                        }
                        masterValueItem.redraw();
                    }
                });

                masterValueItem.addChangeHandler(new ChangeHandler() {
                    public void onChange(ChangeEvent event) {
                        if (event.getValue() == null || event.getValue().toString().length() == 0) {
                            unsetItem.setValue(true);
                        } else {
                            unsetItem.setValue(false);
                        }
                    }
                });

                masterUnsetItem = unsetItem;
            } else {
                masterUnsetItem = new SpacerItem();
            }

            masterUnsetItem.setShowTitle(false);
            masterUnsetItem.setStartRow(false);
            masterUnsetItem.setEndRow(false);
            masterUnsetItem.setAlign(Alignment.CENTER);
            if (masterUnsetItem instanceof CheckboxItem) {
                masterUnsetItem.setValue(false);
            } else {
                masterUnsetItem.setVisible(false);
            }

            // the "set all values to" apply button
            final ButtonItem applyButton = new ButtonItem("apply", MSG.view_groupConfigEdit_setAll());
            applyButton.setDisabled(true);
            applyButton.setAlign(Alignment.RIGHT);
            applyButton.setStartRow(true);
            applyButton.setEndRow(false);

            applyButton.addClickHandler(new ClickHandler() {
                public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                    if (masterValueItem.validate()) {
                        Object value = masterValueItem.getValue();

                        // Update the member property value items.
                        for (ListGridRecord field : data) {
                            String stringValue = (value != null) ? value.toString() : null;
                            field.setAttribute(FIELD_VALUE, stringValue);
                            field.setAttribute(FIELD_UNSET, value == null);
                        }

                        // since we know the master value is ok and has validated,
                        // we can clear all validation errors and re-enable the OK button
                        memberValuesGrid.discardAllEdits();
                        okButton.enable();

                        // redraw grid with the new values
                        memberValuesGrid.redraw();
                    }
                }
            });

            masterValueItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent changedEvent) {
                    applyButton.enable();
                }
            });

            masterUnsetItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent changedEvent) {
                    applyButton.enable();
                    if ((Boolean) changedEvent.getValue()) {
                        applyButton.focusInItem(); // unsetting value, nothing to enter so go to apply button
                    } else {
View Full Code Here

     * @param valueField the field that is editable
     * @param propDef the definition of the property to be edited in the field
     * @return the editor item
     */
    protected FormItem buildEditorFormItem(ListGridField valueField, final PropertyDefinitionSimple propDef) {
        FormItem editorItem = null;

        // note: we don't have to worry about "read only" properties - if the members
        // value editor is in read-only mode or viewing read-only properties, the list grid
        // isn't editable anyway.

        List<PropertyDefinitionEnumeration> enumeratedValues = propDef.getEnumeratedValues();
        if (enumeratedValues != null && !enumeratedValues.isEmpty()) {
            LinkedHashMap<String, String> valueOptions = new LinkedHashMap<String, String>();
            for (PropertyDefinitionEnumeration option : enumeratedValues) {
                valueOptions.put(option.getValue(), option.getName());
            }

            if (propDef.getAllowCustomEnumeratedValue()) {
                editorItem = new ComboBoxItem();
                ((ComboBoxItem) editorItem).setAddUnknownValues(true);
            } else {
                if (valueOptions.size() > 5) {
                    editorItem = new SortedSelectItem();
                } else {
                    // TODO: we want RadioGroupItem, but smartgwt seems to have a bug and it won't render this when
                    //       our listgrid does not have the "unset" boolean field also present. If its just the value
                    //       field, the radio group editor won't show.
                    editorItem = new SortedSelectItem(); // new RadioGroupItem();
                }
            }
            editorItem.setValueMap(valueOptions);
        } else {
            switch (propDef.getType()) {
            case STRING:
            case FILE:
            case DIRECTORY:
                editorItem = new TextItem();
                break;
            case LONG_STRING:
                editorItem = new TextAreaItem();
                break;
            case PASSWORD:
                editorItem = new PasswordItem();
                editorItem.setAttribute("autocomplete", "off");
                break;
            case BOOLEAN:
                // TODO: we want RadioGroupItem, but smartgwt seems to have a bug and it won't render this when
                //       our listgrid does not have the "unset" boolean field also present. If its just the value
                //       field, the radio group editor won't show.
                // RadioGroupItem radioGroupItem = new RadioGroupItem();
                // radioGroupItem.setVertical(false);
                // editorItem = radioGroupItem;
                editorItem = new SelectItem();
                editorItem.setValueMap(BOOLEAN_PROPERTY_ITEM_VALUE_MAP);
                break;
            case INTEGER:
            case LONG:
                editorItem = new TextItem(); // could not get smartgwt listgrid editing to work with IntegerItem
                break;
            case FLOAT:
            case DOUBLE:
                editorItem = new TextItem(); // could not get smartgwt listgrid editing to work with FloatItem
                break;
            }
        }

        editorItem.setName(MEMBER_VALUES_EDITOR_FIELD_PREFIX + "editor");

        List<Validator> validators = buildValidators(propDef, new PropertySimple());
        valueField.setValidators(validators.toArray(new Validator[validators.size()]));

        return editorItem;
View Full Code Here

    private ListGridRecord editedRecord;
    private FormItem defaultProperties;
   
    ListGridEditorContext (JavaScriptObject jsContext) {
       
        FormItem item = FormItem.getOrCreateRef(JSOHelper.getAttributeAsJavaScriptObject(jsContext, "defaultProperties"));
        setDefaultProperties(item);
       
        setRowNum(JSOHelper.getAttributeAsInt(jsContext, "rowNum"));
       
        ListGridField editField = ListGridField.getOrCreateRef(JSOHelper.getAttributeAsJavaScriptObject(jsContext, "editField"));
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.fields.FormItem

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.