You need to sign in to do that
Don't have an account?

open external url as inline in lightning
Hi
I am having a piece of code that will open an external URL.
whhen I click the button it will open the URL in a web tab on the browser.
here's the code
<a href="javascript:void(0);" onclick="{!c.openMyProviderPage}">Find provider</a>
In the controller of the component
openProviderPage : function(component, event, helper) {
debugger;
var pageUrl = component.get("v.findMyProviderURL");
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({"url": pageUrl });
urlEvent.fire();
I do not want the new URL to open in a separate browser window i.e the new URL should open as a subTab inline.
I hope my requirement is clear.
Please help me out at earliest.
I am having a piece of code that will open an external URL.
whhen I click the button it will open the URL in a web tab on the browser.
here's the code
<a href="javascript:void(0);" onclick="{!c.openMyProviderPage}">Find provider</a>
In the controller of the component
openProviderPage : function(component, event, helper) {
debugger;
var pageUrl = component.get("v.findMyProviderURL");
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({"url": pageUrl });
urlEvent.fire();
I do not want the new URL to open in a separate browser window i.e the new URL should open as a subTab inline.
I hope my requirement is clear.
Please help me out at earliest.
or you can use 'window.location.href = 'https://www.xyz.com';' but this will replace the current tab URL with this new link.
Thanks
All Answers
I need to navigate to this url : https://www.superb.com/dsepublic/#/contentPage?page=providerSearchLanding&site_id=medicare
In your approach it does open into a new Tab but also a new browser tab opens. I do not want the browser tab to open, it should be as a separate tab only within salesforce.
Also since the above url is not a part of salesforce lightning it also throws a error.
I tried a different approach.
I created a lightning component, in the doInit event used force:navigateToUrl, then created an app builder page and dragged and dropped the component in the app builder page.
Then I executed the app builder page from the link, it will open a new Tab along with a separate browser tab also. This is not my requirement.
Please let me know any feasible solution .
thanks
meghna
or you can use 'window.location.href = 'https://www.xyz.com';' but this will replace the current tab URL with this new link.
Thanks
It is not possible top open and external URL as a salesforce TAB by using force:navigateToUrl.
Thanks for the idea.