You need to sign in to do that
Don't have an account?
Salesforce Lightning
"WARNING: Callback failed: aura://ComponentController/ACTION$getApplication"
What is solution, plz asap reply ...
Comp.
<aura:component >
<aura:attribute name="list" type="String[]" default="Item 1, Item 2, Item 3"/>
<aura:attribute name="selected" type="String[]"/>
<aura:iteration items="{!v.list}" var="l">
<ui:inputRadio name="qwer" label="{!l}" change="{!c.select}" />
</aura:iteration>
..................... <ui:outputText value="{!v.selected}"/>
</aura:component>
Lightning controller..
({
select : function(component, event, helper) {
var src = event.getSource();
var name = src.get("v.value");
.........console.log(name);
component.set("v.selected", name);
}
})
App
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="SFAuraCMP:Light121"/>
</aura:application>
Thanks,
Deepak
I have updated the code. Just updates the names of Component and App as below:
It is working for me. Please try and verify.
Thanks,
Amit
All Answers
Can you provide the content of SFAuraCMP:Light121 as well?
Actually in above part me also included this component's content
<aura:component >
<aura:attribute name="list" type="String[]" default="Item 1, Item 2, Item 3"/>
<aura:attribute name="selected" type="String[]"/>
<aura:iteration items="{!v.list}" var="l">
<ui:inputRadio name="qwer" label="{!l}" change="{!c.select}" />
</aura:iteration>
..................... <ui:outputText value="{!v.selected}"/>
</aura:component>
And This vf page, where i inclueeded this app
<apex:page standardStylesheets="false" showHeader="false" sidebar="false">
<!-- Include a JavaScript file in your Visualforce page -->
<apex:includeScript value="/lightning/lightning.out.js" />
<div id="lightning" />
<script>
//Tell your Visualforce page to use ExposeVF Lightning app
$Lightning.use("SFAuraCMP:Light121App", function() {
// Write a function that creates the component on the page
$Lightning.createComponent("SFAuraCMP:Light121",
{},
"lightning",
function(cmp) {
// do some stuff
});
});
</script>
</apex:page>
thanks
Deepak
I have updated the code. Just updates the names of Component and App as below:
It is working for me. Please try and verify.
Thanks,
Amit
Thanks
But I have one question that is why is not working this
:: - var elem = evt.getSource().getElement();
var selected = elem.textContent;
Thanks
Deepak(Deny)
Like:
1. https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ui_inputRadio.htm
2. http://salesforce.stackexchange.com/questions/73476/lightning-aura-components-access-to-the-component-attributes
Looks like the code provided in the guide itself also not supporting getElement function of Javascript. So, they might not removed the support for that function. Lets see if anyone from forum comes with any conclunsion.
Thanks,
Amit
Just came to know about your above issue from Srinivasa Somu that you needs to turn off Enable Lightning LockerService Security in Critical Updates. This update supporting only the JS supported functions specified in the https://<yourDomain>.lightning.force.com/auradocs/reference.app
Thanks,
Amit