You are here

Page Controller

SmartBuilder v3 or v4?

Please note that this is the help site for SmartBuilder version 3.

The SmartBuilder version 4 Documentation and Video Tutorials can be found in the Help menu in the tool, or view the v4 Help site.

The Page Controller is only visible on the Master Page.

It is available in the action menus on every page.

The Page Controller has access to page level methods such as onPageLoad, nextPage, previousPage, reload, and others.  On the Master Page, the Page Controller has additional methods available to it.

You can use the Page Controller to communicate between pages.  Because SmartBuilder lesson pages are reset to their initial status when loaded, communicating between pages only really makes sense when it happens between the current page and the Master Page, which is always visible.  Communication between regular pages is typically handled by storing data in variables.

Note: Only one Global Event can be sent at any one time.

Sending a Global Event

This is an example where when a quiz page loads, it will fire a Global Event to disable the menu button, which exists on the Master Page.  When the quiz has been passed, it will fire another Global Event to hide the next mask.  The names of Global Events can be any string.

On the Quiz Page:

Trigger: Page Controller > onPageLoad
Response: Page Controller > fireGlobalEvent = "disableMenu"

Trigger: Question Set 1 > onComplete
Condition: Question Set 1 > isPassed == true
True Response: Page Controller > fireGlobalEvent = "enableMenu"
False Response: [leave blank]

On the Master Page:

Trigger: Page Controller > onEvent
Condition: Page Controller > getEvent == "disableMenu"
True Response: Menu Button > disable
False Response: [leave blank]

 

Trigger: Page Controller > onEvent
Condition: Page Controller > getEvent == "enableMenu"
True Response: Menu Button > enable
False Response: [leave blank]