Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

Adding the Controller

Next we add the controller, in this case a dataController component, to PersonPage.cls. The controller mediates between the view and the model.

Place the following code in PersonPage.cls between the <page></page> tags.

<dataController id="personData"  
    modelId="" />

Note the following about the code:

  • The modelClass attribute associates the dataController with the model class.

  • The modelId attribute represents the object ID of a Caché database object. The dataController passes this value to the model's %OnOpenSource. Our application sets this value dynamically, so here we can specify the empty string as its value.