Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

ZMbasics.Tutorial2.Template

class ZMbasics.Tutorial2.Template extends %ZEN.Mojo.Component.contentTemplate

This is the template for the ZM page ZMbasics.Tutorial2.HomePage.

The primary difference from Tutorial 1 is that *this* tutorial demonstrates the server-side method %OnGetJSONContent().

Next tutorial in the series: ZMbasics.Tutorial3.HomePage.

Method Inventory

Parameters

parameter DOMAIN = Zen Mojo Demo;
Localization domain; best practice is to always specify this
parameter NAMESPACE = http://www.intersystems.com/zen/mojo/ZMTutorial2;
Each template class must have a unique combination of short class name and NAMESPACE parameter.

Methods

classmethod %OnGetJSONContent(pProviderName As %String, pKey As %String, ByRef pParms, Output pObject As %RegisteredObject, pCriteria As %RegisteredObject, pLoad As %Boolean = 0) as %Status
Implementation of callback method. This method provides content for the ZM page that uses this template. Arguments:
  • pProviderName is the name of the provider, as declared in the PROVIDERLIST parameter of the page.
  • pKey is an application-defined key that is used to indicate which content is to be served. Not used in this implementation.
  • pCriteria is an object containing search criteria. Not used in this implementation.
  • pParms is an array of additional parameters from the JSON provider (not currently used).
  • pObject is the object that will be served to the client in JSON format.
  • pLoad is true if this is called when the page is first being served. In this case, this method will be called even though there may a client-side method used to load the content.
clientmethod myGetMainViewLayout(key, criteria) [ Language = javascript ]
Method used to get layout information for the mainView component.
clientmethod onGetContent(providerName, key, criteria) [ Language = javascript ]
Implementation of callback. This client-side method is called by the page method getContent(). If providerName is the name of a layout object, this method invokes myGetMainViewLayout() and returns the result. Otherwise, this method returns null, which means that ZM calls the %OnGetJSONContent() of this template (thus going to the server instead).

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab