Newer Version Available
Lightning Component Code Examples
Object Detail Page
This example displays a canvas app on an Account page using the applicationName and namespacePrefix attributes of <force:canvasApp>.
In myCanvasApp.cmp, we first define an Aura attribute called canvasParameters. We use this attribute to pass a recordId into the canvas app. Next, we define an init handler, which invokes the action method doInit when the component is initialized. In <force:canvasApp>, we set the size of the canvas app in pixels.
In myCanvasAppController.js, the doInit method sets the recordId in the canvasParameters attribute.
Standard Page
This example displays a canvas app in an Aura component using the developerName and namespacePrefix attributes of <apex:canvasApp>. The code specifies the size of the canvas app to be 1000 pixels high and 800 pixels wide. It passes three custom parameters to the canvas app.