You need to sign in to do that
Don't have an account?
Anatoliy Baranchykov
Canvas app in Lightning component showing blank screen every second time
Hi
I have a problem with canvas app on lightning component. Sometimes my canvas app is blank.
Here is an example of my lightning component :
<aura:component implements="force:appHostable" >
<aura:handler name="init" action="{!c.doInit}" value="{!this}" />
<force:canvasApp developerName="MyCanvas" applicationName="MyCanvas" canvasId="Canvas" aura:id="Cars" border="yes" width="100%" height="600" scrolling="yes" namespacePrefix=""/>
</aura:component>
Scenario when not working:
If I open my canvas app from Salesforce Lightning Experience app luncher at first
Salesforce Lightning Experience app luncher -> MyApp -> MyCanvasAppTab
My canvas app is being fully loaded to iframe and i can work with it.
If now i open again my canvas app again using Salesforce Lightning Experience app luncher
Salesforce Lightning Experience app luncher -> MyApp -> MyCanvasAppTab
At this time my canvas app is blank and in iframe i see only blank tags <title></title><body></body>.
I've checked that I'm connected to my external app and return data by canvas app request.
If now I refresh the page with canvas app I see my external up again.
Can somebody help me, please?
Thanks.
I have a problem with canvas app on lightning component. Sometimes my canvas app is blank.
Here is an example of my lightning component :
<aura:component implements="force:appHostable" >
<aura:handler name="init" action="{!c.doInit}" value="{!this}" />
<force:canvasApp developerName="MyCanvas" applicationName="MyCanvas" canvasId="Canvas" aura:id="Cars" border="yes" width="100%" height="600" scrolling="yes" namespacePrefix=""/>
</aura:component>
Scenario when not working:
If I open my canvas app from Salesforce Lightning Experience app luncher at first
Salesforce Lightning Experience app luncher -> MyApp -> MyCanvasAppTab
My canvas app is being fully loaded to iframe and i can work with it.
If now i open again my canvas app again using Salesforce Lightning Experience app luncher
Salesforce Lightning Experience app luncher -> MyApp -> MyCanvasAppTab
At this time my canvas app is blank and in iframe i see only blank tags <title></title><body></body>.
I've checked that I'm connected to my external app and return data by canvas app request.
If now I refresh the page with canvas app I see my external up again.
Can somebody help me, please?
Thanks.
My scenario-canvas lightning component in opportunity layout , assume there are 10 opporutnitites and canvas app opens for the first opporutnity when i got to the second opporutnity canvas app does not load ,loads only upon refresh.
Not sure how to solve this .used window.reload() but goes in to loop, used $A.getrefreshview -loads only the detial page but not the canvas component.
trying to figure out the solution , fingers crossed.
Here is the sample
ComponentCanvas :
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" >
<force:canvasApp developerName="canvasappname" namespacePrefix="" parameters='{"xxx":"123","yyy":"4444"}' width="infinite" />
</aura:component>
ComponentApplication:
<aura:application >
<c:ComponentCanvas />
</aura:application>
cheers!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.
I am facing same issue, but your solution does not seem to work for me. Where was you canvas app located? I am using it as a "Lightning Component" in a Console Utility Bar
Steps to follow :
- When you click for the first time you can see the content of the Canvas App (Salesforce Standard Sample).
- One you click again to hide the component, it becomes invisible event if you click again to display it.
- The DOM/Content is still there, but invisible.
Configuration :
- macOS High Sierra
- Chrome (up to date): Version 63.0.3239.132 (Official Build) (64-bit)
Code:
Lightning Component "CanvasTestComponent"
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
<force:canvasApp developerName="CanvasTest" />
</aura:component>
Thanks in advance.
David Boukhors
For me problem was in parameter "canvasId".
The problem is that if you set this parameter in the <force:canvasApp /> then salesforce create DOM elment with the same "canvasId" each time, but updates the first of them thats why on second time we see blank place. If you delete the "canvasId" then this parameter will be added with the random value.
So the resolution for me is just to delete "canvasId" parameter at all.
Hope this helps.
The problem was resolved for the latest versions of browsers .
For Chrome : Version 65 or later
For Firefox : Version 59 or later