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


class %ZEN.Auxiliary.dataController extends

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.


Parameters Properties Methods Queries Indices ForeignKeys Triggers
3 19


%condition %import %includeFiles %page
%resource alertOnError align autoRefresh
aux composite containerStyle defaultSeries
dragEnabled dropEnabled enclosingClass enclosingStyle
error height hidden hint
hintClass hintStyle id index
label labelClass labelDisabledClass labelStyle
modelClass modelError modelId name
onafterdrag onbeforedrag oncreate ondelete
ondrag ondrop onerror onhide
onnotifyController onrefresh onsave onshow
onupdate parent readOnly showLabel
slice title tuple valign
visible width window

%AddToSaveSet %Attr %BindExport %ClassIsLatestVersion
%ClassName %ConstructClone %DeleteModelInstance %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %DrawComponentHTML %DrawHTML
%DrawJSStrings %EnclosingDivId %Eval %EvalC
%Extends %ForceClientRender %GetDataByName %GetEventHandlers
%GetModelPropertyList %GetParameter %GetTypeByName %GetXMLName
%IsA %IsModified %MakeId %New
%NormalizeObject %ObjectModified %OnAddToPageAfter %OnAddToPageBefore
%OnDrawEnclosingDiv %OnDrawObjectProperties %OnObjectSynch %OnZENDeserialize
%OriginalNamespace %PackageName %QuoteValue %QuoteValueL10N
%RemoveFromSaveSet %Self %SerializeObject %SetDataByName
%SetModified %ValidateObject XMLDTD XMLExport
XMLExportToStream XMLExportToString XMLNew XMLSchema
XMLSchemaNamespace XMLSchemaType createNewObject deleteId
dragFinishHandler dragHandler dragNotifyHandler dragStartHandler
dropHandler dropStartHandler exposeComponent findElement
fireOnUpdateEvent getData getDataAsArrays getDataAsObject
getDataByName getDimSize getDimensions getEnclosingDiv
getError getHidden getHintElement getLabel
getLabelElement getModelClass getModelId getProperty
getPropertyName getSettings getType getTypeByName
hasData invokeAction invokeSuper isModelReadOnly
isOfType isPropertyValid makeId onCreate
onDelete onDisplayHandler onEndModalHandler onPopupAction
onRefreshContents onSerialize onStartModalHandler onloadHandler
onunloadHandler onupdateHandler raiseDataChange refreshContents
render renderContents renderSVG save
sendEventToViews setData setDataByName setHidden
setModelClass setModelId setOverlayMode setProperty
startProgressBar stopProgressBar update


• 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.


• 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:
• method createNewObject() [ Language = javascript ]
Ask our associated dataModel to create a new (unsaved) instance.
• method 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.
• method getModelClass() [ Language = javascript ]
Return the class name of the current model associated with this dataController.
• method 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.
• method 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.
• method setProperty(property, value, value2) [ Language = javascript ]
Set the value of a named property.