XdevListSelect

XdevListSelect

The XdevListSelect is a drop-down list from which the user can select a value. Multiple selections are possible. The drop-down list usually contains the values contained within a column of a database table.

The XdevListSelect is a form component and can be persisted via the XdevFieldGroup

Important properties:
  • ReadOnly 

Important events:
Data binding:
  • Data container (model)

    • XdevBeanItemContainer - Standard data container. The allocation is set using the setContainerDataSource method.

      // Generates a new XdevBeanItemContainer 'productList' XdevBeanItemContainer<Product> productList = new XdevBeanItemContainer<Product>(Product.class);   // Sets the XdevBeanItemContainer listSelect.setContainerDataSource(productList);
    • XdevLazyEntityContainer - RapidClipse exclusively uses this when the property Entity > Auto query data is selected.

Examples:
  • Reset selection - Sets the selection to the initial state. This triggers a valueChange event.

    listSelect.clear();
  • Set focus - Allocates the focus to the XdevListSelect. This can trigger a focus event.

    listSelect.focus();
  • Add entries - Manually adds entries to the XdevListSelect.

    listSelect.addItem("Eintrag 1"); listSelect.addItem("Eintrag 2");

    Direct allocation of multiple entries.

    listSelect.addItems("Eintrag 1", "Eintrag 2", "Eintrag 3", "Eintrag 4");
  • Selected object - Returns the selected object (entity) - Example: category entity.

    BeanItem<Category> selectedItem = listSelect.getSelectedItem(); Category category = selectedItem.getBean();

    or

    Category Category = (Category)listSelect.getValue();

    or - Delivers a list of all selected elements

    List<BeanItem<Category>> selectedItems = listSelect.getSelectedItems();
  • Remove elements - Removes all the elements from the XdevListSelect.

    listSelect.removeAllItems();
  • Select element - Automatic selection of an entry - Example: first entry.

    Collection<?> itemIds = listSelect.getItemIds(); listSelect.setValue(((List<Category>)itemIds).get(0));

All XdevListSelect Methods 

XDEV Software Corp. - One Embarcadero Center, San Francisco, CA 94111, US
Copyright © 2015. XDEV Software Corp. All rights reserved.