4.2.1.2. Initialization Using CreateAction

If the initial value of an attribute depends on the data of the invoking screen, you can use setInitialValues() or setInitialValuesSupplier() methods of the CreateAction class.

See an example of handling Customer and CustomerAddress entities in the demo application:

init values 1
  • customer-address-browse.xml - a screen descriptor with two linked tables, one for customers and another for their addresses.

  • CustomerAddressBrowse.java - the screen controller. In its init() method, the setInitialValuesSupplier() is used to provide initial value for customer attribute of a created address. It will be the currently selected in the first table customer.