You need to sign in to do that
Don't have an account?
John Tracey
Visualforce using lightning out to eventually expose salesforce form in iframe on external website
I am trying to, first, build a visualforce page using lightning component and lightning out. Second, I would like to have this visualforce page able to be exposed using iframe on external website. Here is what I have so far. It's in my DE org at the present. (This is all from documentation found on Salesforce) I'm using a simple "Hello World" component just to make things easier. I can the form later once I get the solution to view in iframe. The problem is I'm not even getting past first base with this. Which is to simply preview the app in dev console.
myAppContainer.app
<aura:application access="GLOBAL" extends="ltng:outApp"
implements="ltng:allowGuestAccess">
<aura:dependency resource="c:myAppComponent"/>
</aura:application>
myAppComponent.cmp
<aura:component>
<h1>Hello World</h1>
</aura:component>
myAppVF.vfp
<apex:page >
<apex:includeLightning />
<div id="lightningLocator">
</div>
<script>
$Lightning.use("c:myAppContainer", // I believe this one is correct
function() { // Callback once framework and app loaded
$Lightning.createComponent(
"c:myAppComponent", // I believe this one is correct
{ }, // attributes to set on the component when created
"lightningLocator", // Not Sure about this one -the DOM location to insert the component
function(cmp) {
// callback when component is created and active on the page
}
);
},
'https://NotSureAboutThisOne/' // I have no idea what this is supposed to be. Community endpoint
);
</script>
</apex:page>
When I preview the app in dev console I get this error.
I either get this error or it hangs on LOADING graphic.
Thanks for any help you may have to offer. I'm only an admin but i do have years fop experience with php and mysql so this should not be a huge leap for me.
myAppContainer.app
<aura:application access="GLOBAL" extends="ltng:outApp"
implements="ltng:allowGuestAccess">
<aura:dependency resource="c:myAppComponent"/>
</aura:application>
myAppComponent.cmp
<aura:component>
<h1>Hello World</h1>
</aura:component>
myAppVF.vfp
<apex:page >
<apex:includeLightning />
<div id="lightningLocator">
</div>
<script>
$Lightning.use("c:myAppContainer", // I believe this one is correct
function() { // Callback once framework and app loaded
$Lightning.createComponent(
"c:myAppComponent", // I believe this one is correct
{ }, // attributes to set on the component when created
"lightningLocator", // Not Sure about this one -the DOM location to insert the component
function(cmp) {
// callback when component is created and active on the page
}
);
},
'https://NotSureAboutThisOne/' // I have no idea what this is supposed to be. Community endpoint
);
</script>
</apex:page>
When I preview the app in dev console I get this error.
I either get this error or it hangs on LOADING graphic.
Thanks for any help you may have to offer. I'm only an admin but i do have years fop experience with php and mysql so this should not be a huge leap for me.