Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The XdevComboBox is a combination of an input field, a button, and a drop-down list, from which the user can select a value. The drop-down list predominantly contains the values contained in a given column in the database table.

...

  • Data container (model)
    • XdevBeanItemContainer - Standard data container. The allocation is set using the setContainerDataSource method.

      Code Block
      languagejava
      themeConfluence
      // Generates a new XdevBeanItemContainer 'productList'
      XdevBeanItemContainer<Product> productList = new XdevBeanItemContainer<Product>(Product.class);
       
      // Sets the XdevBeanItemContainer
      comboBox.setContainerDataSource(productList);


    • XdevLazyEntityContainer - RapidClipse exclusively uses this when the property Entity > Auto query data is selected.
Examples:
  • Add entries : Manually add entries to the XdevComboBox.

    Code Block
    languagejava
    themeConfluence
    comboBox.addItem("Eintrag 1");
    comboBox.addItem("Eintrag 2");

    Direct allocation of multiple entries.

    Code Block
    languagejava
    themeConfluence
    listSelect.addItems("Eintrag 1", "Eintrag 2", "Eintrag 3", "Eintrag 4");


  • Selected object - Returns the selected object (entity) - Example: category entity.

    Code Block
    languagejava
    themeConfluence
    Category Category = comboBox.getSelectedItem();

    or

    Code Block
    languagejava
    themeConfluence
    Category Category = (Category)comboBox.getValue();


  • Remove elements : Removes - Removes all the elements from the XdevComboBox.

    Code Block
    languagejava
    themeConfluence
    comboBox.removeAllItems();


  • Select element - Automatic selection of an entry - Example: first entry.

    Code Block
    languagejava
    themeEclipse
    Collection<?> itemIds = comboBox.getItemIds();
    comboBox.setValue(((List<Category>)itemIds).get(0));


...