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

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


    scaleItem.setValueMap(availableScales.toArray(new String[availableScales.size()]));
  }

  private void init() {
    DynamicForm form = new DynamicForm();
    scaleItem = new ComboBoxItem();
    scaleItem.setTitle(I18nProvider.getToolbar().scaleSelect());
    scaleItem.setValidators(new ScaleValidator());
    scaleItem.setValidateOnChange(true);
    scaleItem.addKeyPressHandler(this);
    scaleItem.addChangedHandler(this);
View Full Code Here


    setHeight(28);
    setWidth(200);

    // Build a small form with a select item for locales:
    DynamicForm form = new DynamicForm();
    ComboBoxItem localeItem = new ComboBoxItem();
    localeItem.setValueMap(locales.values().toArray(new String[locales.size()]));
    localeItem.setTitle(I18nProvider.getGlobal().localeTitle());

    // Show the current locale value in the select item:
    String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName();
    localeItem.setValue(locales.get(currentLocale));

    // Add the changed handler, and build the widget:
    localeItem.addChangedHandler(this);
    form.setFields(localeItem);
    addChild(form);
  }
View Full Code Here

            setBodyDefaults(bodyDefaults);

            final DynamicForm form = new DynamicForm();
            addItem(form);

            tagInputItem = new ComboBoxItem("tag");
            tagInputItem.setShowTitle(false);
            tagInputItem.setHideEmptyPickList(true);
            tagInputItem.setValueField("tag");
            tagInputItem.setDisplayField("tag");
            tagInputItem.setType("comboBox");
View Full Code Here

                for (PropertyDefinitionEnumeration option : propertyDefinitionSimple.getEnumeratedValues()) {
                    valueOptions.put(option.getValue(), option.getName());
                }

                if (propertyDefinitionSimple.getAllowCustomEnumeratedValue()) {
                    valueItem = new ComboBoxItem();
                    ((ComboBoxItem) valueItem).setAddUnknownValues(true);
                } else {
                    if (valueOptions.size() > 3) {
                        valueItem = new SelectItem();
                    } else {
View Full Code Here

            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 {
View Full Code Here

   
  }
 
 
  private void createTextInput() {
    endpoint = new ComboBoxItem("endpoint", "Endpoint");
    endpoint.setValueField(Endpoints.KEY_ENDPOINT);
    endpoint.setAddUnknownValues(true);
    endpoint.setCompleteOnTab(true);
    endpoint.setWidth(WIDTH);
    endpoint.setOptionDataSource(view.getEndpointDataSource());
View Full Code Here

        final DynamicForm form = new DynamicForm();
        form.setID("severityForm");
        form.setWidth(200);
        form.setItemHoverWidth(200);

        final ComboBoxItem severityLevel = new ComboBoxItem();
        severityLevel.setTitle("Severity Level");
        severityLevel.setValueMap("Severity 1", "Severity 2", "Severity 3");
        severityLevel.setDefaultValue("Severity 2");
        severityLevel.addItemHoverHandler(new ItemHoverHandler() {
      public void onItemHover(ItemHoverEvent event) {
        String prompt = "Status can only be changed by the bug's owner";
            if (!severityLevel.isDisabled()) {
              prompt = getHoverText((String) severityLevel.getValue());
            }
        severityLevel.setPrompt(prompt);
      }
        });
       
        final ButtonItem buttonItem = new ButtonItem();
        buttonItem.setTop(40);
        buttonItem.setWidth(150);
        buttonItem.setTitle("Enable/disable field");
        buttonItem.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        severityLevel.setDisabled(!severityLevel.isDisabled());
      }
        });

        form.setFields(severityLevel, buttonItem);
View Full Code Here

        findItem.setWidth(70);
        findItem.setEndRow(false);

        TextItem skuItem = new TextItem("SKU");

        itemName = new ComboBoxItem("itemName");
        itemName.setOptionDataSource(supplyItemDS);
        itemName.setPickListWidth(250);

        CheckboxItem findInCategory = new CheckboxItem("findInCategory");
        findInCategory.setTitle("Use Category");
View Full Code Here

        });

        searchForm = new SearchForm(supplyItemDS);

        //when showing options in the combo-box, only show the options from the selected category if appropriate
        final ComboBoxItem itemNameCB = searchForm.getItemNameField();
        itemNameCB.setPickListFilterCriteriaFunction(new FilterCriteriaFunction() {
            public Criteria getCriteria() {
                ListGridRecord record = categoryTree.getSelectedRecord();
                if ((itemNameCB.getValue() != null) && record != null) {
                    Criteria criteria = new Criteria();
                    criteria.addCriteria("category", record.getAttribute("categoryName"));
                    return criteria;
                }
                return null;
View Full Code Here

        final DynamicForm form = new DynamicForm();
        form.setWidth(500);
        form.setNumCols(4);

        ComboBoxItem bugStatusItem = new ComboBoxItem("bugStatus");
        bugStatusItem.setTitle("Bug Status");

        LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
        valueMap.put("new", "New");
        valueMap.put("active", "Active");
        valueMap.put("revisit", "Revisit");
        valueMap.put("fixed", "Fixed");
        valueMap.put("delivered", "Delivered");
        valueMap.put("resolved", "Resolved");
        valueMap.put("reopened", "Reopened");

        bugStatusItem.setValueMap(valueMap);


        ComboBoxItem itemName = new ComboBoxItem("itemName");
        itemName.setTitle("Item Name");
        itemName.setPickListWidth(250);
        itemName.setOptionDataSource(supplyItemDS);
        form.setItems(bugStatusItem, itemName);

        return form;
    }
View Full Code Here

TOP

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

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.