Initializing pages

Version: 9.0

Understanding how SPEAK initializes a page can sometimes help you understand why pages that you create do not work as expected.

The PageCode component initializes a page. All SPEAK pages must have this component. The PageCode component:

  • Parses the page and instantiates all components and controls.

  • Combines all component and controls in a JavaScript data object - the page model.

  • Handles UI events, such as clicks and selections, and updates the page model to reflect changes.

  • Inserts links to the CSS files and JavaScript files that all SPEAK pages use.

For example, if a page contains a TextBox control that has SearchTextBox as an ID, when the PageCode component has initialized this component, it creates the reference Sitecore.app.SearchTextBox. You can access the Text property of the SearchTextBox like this:

RequestResponse
var text = this.SearchTextBox.get(“text”);

Do you have some feedback for us?

If you have suggestions for improving this article,