Skip to main content


class ZMbasics.Tutorial1.HomePage extends %ZEN.Mojo.basePage

Sample Zen Mojo tutorial page, with one <mojo:documentView>, which is a general container.

To specify the appearance of the <mojo:documentView>, this sample uses the ongetlayout callback attribute. This returns a JSON string that describes the contents of the component, in terms of a set of layout objects defined by the plugins used in this &;lt;documentView. This callback is defined as follows:

ongetlayout="return zenPage.getContent('mainViewLayout',key,criteria);"

The method getContent() is a built-in page method that you can use to retrieve a content object, in this case a layout graph. This method:

  1. Calls the onGetContent() method of the associated template class. If that method returns content for the given key, ZM uses that content.
  2. Otherwise, ZM calls the %OnGetJSONContent() method of the same template class (not demonstrated here).

Within <mojo:documentView>, the developerMode="true" option adds a toggle button that you can use to see the JSON data and layout strings available to the component.

This ZM page class uses the template class ZMbasics.Tutorial1.Template.

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

Method Inventory


parameter DOMAIN = Zen Mojo Demo;
Localization domain; best practice is to always specify this
parameter TEMPLATECLASS = ZMbasics.Tutorial1.Template;
Name of the default template class that this page uses.


method %GetAppSettings(pPage As %String = "", pMode As %String = "") as %ZEN.proxyObject
Method override for this page. This method defines the application name, which controls the name shown on the browser tab.
This implementation erases the default contents of the header area.
clientmethod adjustContentSize(load, width, height) [ Language = javascript ]
Implementation for this page. This method adjusts the size of the documentView components within the content area based on the current width and height of the screen. In this case there is only one documentView.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab