View Adapter Definitions and Controls

A view adapter definition defines the structure of the view that it is expected to be bound to. A control is an instance of another view adapter that serves as a component of the parent view adapter and that is either defined as a part of the parent view adapter structure or as an independent external view adapter itself that is to be "docked" to the parent. A view adapter definition consists of the following properties:

  • controls
    • child view adapter definitions embedded within the parent view adapter definition; each control definition may also have one or more initializer properties;
  • events
    • list of events defined by the view adapter
  • members
    • list of methods defined by the view adapter

Each component control of a view adapter is listed by key under thecontrolsstructure. Controls themselves may contain nested controls under their own subset definition structure. Some controls may be defined as a repeater type control, in which case they will contain arepeatstructure in place of acontrolsstructure.

Events are a simple array containing a list of event names to be defined by the view adapter. Consumers of the view adapter may listen to these events by accessing the event name as a key of theonproperty of the view adapter instance.

Members is a hash map that contain functions by key that are to be grafted onto the view adapter instances created from the adapter definition. These functions are bound to the view adapter instance which is accessible via thethiskeyword.

Note that the instance of the root view adapter defined within a view adapter definition class is accessible via a scoped parameter defined in the class' function signature (generally namedviewAdapter,controlViewAdapterorappViewAdapterby recommended convention).

results matching ""

    No results matching ""