You need to sign in to do that
Don't have an account?
Tonima Mallick 7
I am facing issue in my code.I want that simply on button click open any url(www.google.com)
Here is my code
//------COMPONENT--------//
<aura:component implements="force:appHostable" access="global" controller="ValidateButton1">
<!--<ui:button class="abc" label="Validate" press="{!c.navigate}" />-->
<ui:button class="abc" label="Validate" press="{!c.navigateToRecord}" />
</aura:component>
//----------------CONTROLLER-----------------//
({
doInit : function(component, event, helper){
console.log('1324');
console.log('id'+component.get("v.recordId"));
},
navigateToRecord : function (component, event, helper) {
helper.navigateToRecord(component);
},
})
//---------------------HELPER------------------//
({
navigateToRecord : function() {
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": 'https://www.google.com'
});
urlEvent.fire();
}
})
Thanks in advance
please help me out
On button click open url
I am facing issue in my code.I want that simply on button click open any url(www.google.com)
Here is my code
//------COMPONENT--------//
<aura:component implements="force:appHostable" access="global" controller="ValidateButton1">
<!--<ui:button class="abc" label="Validate" press="{!c.navigate}" />-->
<ui:button class="abc" label="Validate" press="{!c.navigateToRecord}" />
</aura:component>
//----------------CONTROLLER-----------------//
({
doInit : function(component, event, helper){
console.log('1324');
console.log('id'+component.get("v.recordId"));
},
navigateToRecord : function (component, event, helper) {
helper.navigateToRecord(component);
},
})
//---------------------HELPER------------------//
({
navigateToRecord : function() {
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": 'https://www.google.com'
});
urlEvent.fire();
}
})
Thanks in advance
please help me out
This event is handled by the one.app container. It’s supported in Lightning Experience and Salesforce1 only.
app.app is not supported this event here you can use directly
like thanks
let me inform if my answer helps you
All Answers
This event is handled by the one.app container. It’s supported in Lightning Experience and Salesforce1 only.
app.app is not supported this event here you can use directly
like thanks
let me inform if my answer helps you
but if when I added that component in my page then I have use this code?
navigateToRecord : function() {
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": 'https://www.google.com'
});
urlEvent.fire();
}
})
but not single apps.app application
thanks