You need to sign in to do that
Don't have an account?
DaAy
How to make Lightning Component events work in Lightning Out
Hi,
I wanted to make event work in Lightning out when Lightning component is embedded into a Visualforce page. When I include <aura:dependency resource="markup://force:*" type="Event"/> in the Lightning dependency app I get the following error
An internal server error has occurred
Error ID: 268240336-7606 (1856451655)
org.auraframework.throwable.quickfix.InvalidDefinitionException: No enum constant org.auraframework.def.DefDescriptor.DefType.Event
at .(0AdA00000004Q0n:3)
at .(0AdA00000004Q0n:3)
at org.auraframework.impl.root.DependencyDefImpl.<init>(DependencyDefImpl.java:55)
at org.auraframework.impl.root.DependencyDefImpl$Builder.build(DependencyDefImpl.java:151)
at org.auraframework.impl.root.parser.handler.DependencyDefHandler.createDefinition(DependencyDefHandler.java:93)....
Following is the code I am using for the dependency app
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="ui:button"/>
<aura:dependency resource="markup://force:*" type="EVENT"/>
</aura:application>
Following is the Visualforce page code
<apex:page >
<apex:includeLightning />
<div id="lightning" />
<script>
$Lightning.use("c:lcvTest", function() {
$Lightning.createComponent("c:spotlightAccountSetting",
{ headingLabel : "Press Me!" , headingText : "Press Me!" },
"lightning",
function(cmp) {
///
});
});
</script>
</apex:page>
help would be appreciated
Thanks
I wanted to make event work in Lightning out when Lightning component is embedded into a Visualforce page. When I include <aura:dependency resource="markup://force:*" type="Event"/> in the Lightning dependency app I get the following error
An internal server error has occurred
Error ID: 268240336-7606 (1856451655)
org.auraframework.throwable.quickfix.InvalidDefinitionException: No enum constant org.auraframework.def.DefDescriptor.DefType.Event
at .(0AdA00000004Q0n:3)
at .(0AdA00000004Q0n:3)
at org.auraframework.impl.root.DependencyDefImpl.<init>(DependencyDefImpl.java:55)
at org.auraframework.impl.root.DependencyDefImpl$Builder.build(DependencyDefImpl.java:151)
at org.auraframework.impl.root.parser.handler.DependencyDefHandler.createDefinition(DependencyDefHandler.java:93)....
Following is the code I am using for the dependency app
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="ui:button"/>
<aura:dependency resource="markup://force:*" type="EVENT"/>
</aura:application>
Following is the Visualforce page code
<apex:page >
<apex:includeLightning />
<div id="lightning" />
<script>
$Lightning.use("c:lcvTest", function() {
$Lightning.createComponent("c:spotlightAccountSetting",
{ headingLabel : "Press Me!" , headingText : "Press Me!" },
"lightning",
function(cmp) {
///
});
});
</script>
</apex:page>
help would be appreciated
Thanks
Inorder to work event in lightning out, you have handle those methods, In my example I am handling the force:navigateToSObject,
Even if you are in Lightning and opening the vfpage, it acts like classic so you have to handle those methods by eventservice handler
Here is the small example for the Please take a look
Let me know if you have any questions
Thanks
Pramodh