Controls
This class holds the controls associated with an instance of a model. The controls can be accessed via their key names. The following functions are useful when accessing controls.
controlKeys() returns the names of the controls
hasControl(name:String) checks if name is a control
asList() the controls as a list
asListByType(controlType: ControlType) a filtered list of controls by control type
control(controlKey: String) returns the named control or null
controlTypes() the set of control types used by the model
asMap() - all the controls as a map, with the pairs (control name, value)
setControlsFromMap(controlMap: Map
) perhaps the most useful of the functions. Sets the controls by name to the supplied value for each control. setControlsFromJSON(json: String) assumes that the JSON represents a control map and sets the controls as specified.
controlsMapAsJsonString() a JSON string representation of a control map
controlData() a list holding instances of ControlData of all the controls for data transfer purposes
controlDataAsString() a string representation of the control data
Functions
The type should be associated with a valid control type.
Gets a control of the supplied key name or null
Return a List of ControlData providing additional detail on Controls (but without giving direct access to the control)
A JSON representation of the map of pairs (keyName, value) for the controls
Sets all the contained control values using the supplied flat map