Bungee Logic : Intrinsic : Model
Contents |
[edit] Description
Each control adapter contains two intrinsic functions associated with the adapter: Model and View.
Use the Model function to add code to an adapter so that you can cause programmatic updates to your application's View (UI). This may sound contradictory, but the updates to the View are based on changes in your Model (application objects), hence this is Model code.
[edit] Adding Model Code
- You add Model code to the desired adapter field by by clicking the M (Add Model Code) button next to that field.
[edit] Variables
Model functions contain two intrinsic variables:
- var Object context--provides a way to access the object context of the adapter
- var (adapter type) view--provides a way to access the fields of the adapter
[edit] Example
There is an example of Model code in Example 3 of the DynamicForm control documentation. The code (shown below) updates the View (the form displayed) based on changes to the Model (the value of a string field called formType). Based on the code in the Model function below, changes to the value of formType programmatically determine whether a "read-only" or "editable" form gets displayed to the user.

[edit] Properties
General Tab
- Execute On Initialization—Allows you to specify whether or not to fire the function on initialization of the adapter
- Name—The name of the function
- Trigger—Allows you to specify an object member whose value changes triggers the Model function
[edit] See Also



