No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
apex:canvasApp Component
Use this component to display a canvas app on a Visualforce page. The table below lists the component attributes.
Alternatively, you can also use the JSENCODE function to escape the strings:
Note that when using non-alphanumeric characters such as quotation marks, apostrophes, and so on, ensure that you pass the parameters in as JavaScript-safe objects. Do this by using an Apex class to build the JSON string using JSONGenerator, and then calling the Apex class from the parameters value:
1<apex:page controller="JSONGeneratorSample">
2 <apex:canvasApp developerName="mycanvas" parameters="{!generateJSON}" />
3</apex:page>1<apex:page standardController="Account">
2 <apex:canvasApp developerName="mycanvas" parameters="{!JSENCODE(Account.Description)}" />
3</apex:page>| Attribute | Type | Description |
|---|---|---|
| applicationName | String | Name of the canvas app. Either applicationName or developerName is required. |
| border | String | Width of the canvas app border, in pixels. If not specified, defaults to 0 pixels. |
| canvasId | String | Unique ID of the canvas app window. Use this attribute when targeting events to the canvas app. |
| containerId | String | ID of the HTML element in which the canvas app is rendered.
If not specified, defaults to null. The container specified by this
attribute can’t appear after the <apex:canvasApp> component. These code examples show
valid usage of the <div> container
and the containerId attribute:This code example shows invalid usage of the <div> container and the containerId attribute: |
| developerName | String | Internal name of the canvas app. You specify this value in the API Name field when you expose the canvas app by creating a connected app. Either developerName or applicationName is required. |
| height | String | Canvas app window height, in pixels. If not specified, defaults to 900 pixels. |
| id | String | Unique identifier that allows the <apex:canvasApp> component to be referenced by other components on the page. |
| namespacePrefix | String | Namespace value of the Developer Edition organization in which the canvas app was created. You can set a namespace only in a Developer Edition organization, so this is optional if the canvas app was created in a different type of organization. If not specified, defaults to null. |
| onCanvasAppError | String | Name of the JavaScript function to be called if the canvas app fails to render. |
| onCanvasAppLoad | String | Name of the JavaScript function to be called after the canvas app loads. |
| parameters | String | Object representation of parameters passed to the canvas app. Supply in JSON format or as a JavaScript object literal. Here’s an example of parameters in a JavaScript object literal: {param1:'value1',param2:'value2'}. If not specified, defaults to null. |
| rendered | Boolean | Specifies whether the component is rendered on the page. If not specified, defaults to true. |
| scrolling | String | Specifies whether the canvas app window uses scroll bars. If not specified, defaults to no. |
| width | String | Canvas app window width, in pixels. If not specified, defaults to 800 pixels. |