Home > Class Reference > ENSLIB namespace > %ZEN.Auxiliary.dataController

%ZEN.Auxiliary.dataController

class %ZEN.Auxiliary.dataController extends %ZEN.Auxiliary.abstractController

This class is used to implement the Controller portion of the Zen Model-View-Controller mechanism.
A dataController component provides a way to establish a connection between a DataModel class and one or more %ZEN.Component.dataView components (such as a form).
When the data associated with the Controller changes, these changes are automatically broadcast to all View components connected to the Controller.
For example, the following XML defines a dataController that will open an instance of the MyApp.MyModel class using an id value of 1. The %ZEN.Component.dynaForm object is bound to the dataController by setting its controllerId property to the id of the dataController:
<dataController id="data" modelClass="MyApp.MyModel" modelId="1"/>
<dynaForm id="myForm" controllerId="data"/>
In this case, the %ZEN.Component.dynaForm will display a form with controls for every property within the Data Model.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property modelClass as %ZEN.Datatype.className (ZENEXPRESSION = 1);
Name of the DataModel class that provides data for this controller.
You can change this value using the client-side setModelClass() method. This will cause a new object to be loaded into the controller.
Property methods: modelClassDisplayToLogical(), modelClassGet(), modelClassIsValid(), modelClassLogicalToDisplay(), modelClassLogicalToOdbc(), modelClassNormalize(), modelClassSet()

Methods (Including Private)

classmethod %DeleteModelInstance(pClass As %String, pID As %String) as %Status
Delete an instance of a DataModel object.
method %GetModelPropertyList(Output pSC As %Status) as %String
Return a comma-delimited list of the properties contained in the current DataModel class.
A property in the list may include type and label information in the form:
Prop:type:label
clientmethod createNewObject() [ Language = javascript ]
Ask our associated dataModel to create a new (unsaved) instance.
clientmethod deleteId(id) [ Language = javascript ]
Ask our associated dataModel to delete the item with the given id. Returns true if the delete was successful. If the dataModel is readOnly, then the delete will not happen.
clientmethod getModelClass() [ Language = javascript ]
Return the class name of the current model associated with this dataController.
clientmethod save() [ Language = javascript ]
Save data from this dataController back to the DataModel on the server. Return the id with which the model was saved or '' if it was not saved.
clientmethod setModelClass(cls, id) [ Language = javascript ]
This method lets you set the values of both the modelClass and (if provided) modelId properties for this controller. This will cause new data to be loaded and any views connected to this controller to refresh.
This is useful in cases where both the model class and id need to change as this method changes both with a single call to the server.
clientmethod setProperty(property, value, value2) [ Language = javascript ]
Set the value of a named property.

Inherited Members

Inherited Properties (Including Private)