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:
-
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, thesetInitialValuesSupplier()
is used to provide initial value forcustomer
attribute of a created address. It will be the currently selected in the first table customer.