canvas

Purpose

Block-level element used to contain pages.

Contained layout and timer elements are valid for the canvas types 'main', 'portal', 'portlet', 'gear' and 'inclusion' that are not treated as a group. See Types of canvas for more information.

The canvas and region elements are only valid for the canvas types 'main' and 'portal' that are treated as a group.

Page caching is set to 'none' by default, and no caching takes place. If the cacheScope attribute has one of the other possible values caching for the page is enabled and the cache will contain the entire content rendered for the target device. If you set it to 'optimistic', the cache key is based on the static XDIME on the page, and pipeline markup is ignored. A value of 'safe' causes MCS to process all pipeline markup before calculating the key. See Caching XDIME pages for details of the caching operation, and how you should use these settings.

Contained by

Contains

Attributes

Attribute Description Type Default Options Use
brand

The path to a brand folder.

Note:

The brand attribute is not supported by Mobile Portal Accelerator.

xs:string none    optional 
cacheScope Sets the scope for page caching for this page. Overrides the default setting of 'none' in the MCS configuration file. xs:string none  optimistic, safe, none  optional 
initialFocus The initial focus of the canvas xs:IDREF none    optional 
onenter Script policy to execute when a canvas is entered xs:string none    optional 
onenterbackward Script policy to execute when a canvas is entered in the backward direction xs:string none    optional 
onenterforeward Script policy to execute when a canvas is entered in the forward direction xs:string none    optional 
onload Script policy to execute immediately after a page is loaded. xs:string none    optional 
onresize Script policy to execute when a window or frame is resized. xs:string none    optional 
ontimer Script policy to execute when a timer event occurs xs:string none    optional 
onunload Script policy to execute when a user exits a page. xs:string none    optional 
overlay The default value "false" renders the canvas as part of a main canvas. Some protocols, such as WML, allow grouping several logical pages into a single physical page. In these cases, setting the overlay attribute to "true" renders that canvas as a separate logical page. xs:boolean false  true, false  optional 
pageUsage If a page is an error page it should be stopped from processing parameters passed to it by setting this attribute to "error" xs:string none    optional 
type The type of canvas xs:string main  main, portal, portlet, gear, inclusion  optional 
uaContext When "new" is set on WML devices only, all the context variables for the browser are cleared. There is no effect on other protocols. The default leaves the context variables as they are xs:string current  current, new  optional 

Attribute groups

Example

The welcome.mlyt layout can be found in the MCS/repository/xml-repository directory.

<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/welcome.mlyt" pageTitle="canvas">
  <pane name="background">
    <h3>Hello</h3>
    <p>MCS provides a comprehensive, standards-based,
      development and execution environment for delivering
      multi-channel content, applications and services that
      are automatically optimized for thousands of different
      consumer devices. </p>
  </pane>
</canvas>

Related topics