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:
Include Page Property Auto query data Property Auto query data Include Page Property ConnectedForm Property ConnectedForm Include Page Property Entity Property Entity Include Page Property ItemCaptionFromAnnotation Property ItemCaptionFromAnnotation Include Page Property ItemCaptionValue Property ItemCaptionValue Include Page Property Master component Property Master component Include Page Property MultiSelect Property MultiSelect - ReadOnly
Include Page Property Required Property Required Include Page Property RequiredError Property RequiredError Include Page Property Rows Property Rows Include Page Property TabIndex Property TabIndex
...
Add entries - Manually adds entries to the XdevListSelect.
Code Block language java theme Confluence listSelect.addItem("Eintrag 1"); listSelect.addItem("Eintrag 2");
Direct allocation of multiple entries.
Code Block language java theme Confluence listSelect.addItems("Eintrag 1", "Eintrag 2", "Eintrag 3", "Eintrag 4");
Selected object - Returns the selected object (entity) - Example: category entity.
Code Block language java theme Confluence BeanItem<Category> selectedItem = listSelect.getSelectedItem(); Category category = selectedItem.getBean();
or
Code Block language java theme Confluence Category Category = (Category)listSelect.getValue();
or - Delivers a list of all selected elements
Code Block language java theme Confluence List<BeanItem<Category>> selectedItems = listSelect.getSelectedItems();
Remove elements - Removes all the elements from the XdevListSelect.
Code Block language java theme Confluence listSelect.removeAllItems();
Select element - Automatic selection of an entry - Example: first entry.
Code Block language java theme Eclipse Collection<?> itemIds = listSelect.getItemIds(); listSelect.setValue(((List<Category>)itemIds).get(0));