Entity - Sets the entity assigned via drag and drop.
this.table.setContainerDataSource(Products.class, NestedProperty.of("categories.categoryname", String.class), NestedProperty.of("categories.description", String.class)); |
Properties - Generates corresponding columns in the XdevTable for the properties (data fields) set here.
this.table.setVisibleColumns("productname", "quantityperunit", "unitprice", "unitsonorder", "reorderlevel", "categories.categoryname", "categories.description"); |
Auto query data - Sets the Auto query data property. Determines that the XdevBeanItemContainer is used as data container.
Preview
Open XdevTable properties wizard: In the Properties > Entity > Properties click on... .
Read selected row
Products product = table.getSelectedItem().getBean(); |
Saves the values of the selected row in the product variable of Products type.
Cannot be used for multiple selection.
Read individual value
Products product = table.getSelectedItem().getBean(); String productName = product.getProductname(); |
Multiple selection - Read selected rows
List<BeanItem<Products>> productList = table.getSelectedItems(); |
Return XdevTable Data-Container - Generates a new XdevBeanItemContainer productContainer of Product type and assigns this to the XdevBeanItemContainer of the XdevTable with the getBeanContainerDataSource method.
XdevBeanItemContainer<Product> productContainer = table.getBeanContainerDataSource(); |
Read XdevTable data
List<Product> productList = new ArrayList<Product>(); for (Object i : table.getItemIds()) { Product bean = table.getBeanItem(i).getBean(); productList.add(bean); } |
Assign XdevBeanItemContainer to another XdevTable - Assigns the XdevBeanItemContainer productContainer to the XdevTable with the setContainerDataSource method.
table2.setContainerDataSource(table1.getBeanContainerDataSource()); |
Table Refresh - Resets the model, generally XdevBeanItemContainer, when AutoQueryData is active. With this, the table is updated.
table.getBeanContainerDataSource().refresh(); |