A developer can add functionality, such as inter-part communication or linking a button to an action, to a form by writing a Layout Control, which adds behavior to a form. A Layout Control for a Form Template is like ASP.NET Code Behind for a Web page.
A developer can also utilize this layout control logic with meta-data based wizards by specifying a form configured with a Layout Control. See Administering Metadata Wizards for more details on creating meta-data based wizards. For developers who are familiar with an Aptify release prior to 4.0, a Layout Control replaces most situations where compiled viewer forms and composite controls would have been used in version 3.5 and earlier.
A developer typically writes a Layout Control to perform one or more of the following actions on a form:
- Enable/disable controls based on behavior
- Invoke flow-down logic
- Invoke UI validation
The Aptify Windows Desktop interface and the Aptify web interface each require a separate layout control, due to the differences between the Windows and Web environments.
After the Layout Control has been written and compiled, a developer adds it to the Aptify Object Repository and links it to the top-level Form Templates record for the appropriate form.
The Motor Loaner System sample application includes three examples of a Windows Layout Control for the Rental Agreements, Associates, and Manufacturers entity (see About the Configurations Included in the Sample Application for more information).
This topic focuses on the Rental Agreements layout control, which disables fields that are not applicable depending on the rental agreement's status (for example, Check-in fields are disabled for vehicles that have not been checked out yet). The logic that prevents modification to fields based on record state is implemented in the Rental Agreements entity object but the layout control enforces this behavior visually at the user interface. The layout control also automatically sets a Rental Agreement's Starting Mileage when a user specifies a Vehicle (based on the selected Vehicle's Current Mileage).
This topic contains the following sub-topics that describe how to write a Layout Control and the effects of a Layout Control using the sample application Rental Agreement layout control as an example: