Table Column Generator with UI (typed)
Result:
A new UI component of type XdevHorizontalLayout is generated, which implements the ColumnGenerator interface.
The UI component is typed and thus enables an easy access to the values of a row
@SuppressWarnings("unchecked") public Products getBean() { return ((XdevTable<Products>) getTable()).getContainerDataSource().getItem(getItemId()).getBean(); }
In the Project Management > User Interface, the new UI component is displayed and can thus be edited in GUI builder, can be configured via Properties and can be enhanced in the Java code view.
- In the Project Management > User Interface > select the generate UI component GeneratedColumn.
- In the GUI builder, change the label of the xdevButton generated as sample to Purchase.
- Under Properties > Icon click on ..., in the subsequent dialog, click on FontAwesome, select an icon and click on OK.
- On the left next to the XdevButton, insert an XdevTextField and enter 1 as default value.
- Click on Save
Read values from the current row
With the getBean() method, you can read the individual values of the row.
Example 1:
String productName = getBean().getProductname();
Example 2:
Integer productID = getBean().getProductid();
Example 3:
BigDecimal unitPrice = getBean().getUnitprice();
Tip:
Select row - The row is selected with the method - invoke selectItem().
selectItem();
XDEV Software Corp. - One Embarcadero Center, San Francisco, CA 94111, US
Copyright © 2015. XDEV Software Corp. All rights reserved.