3

Scenario:

  1. I want to create a List Button which displays a Lightning Component.

    • The only way to implement this step is to use a Visualforce Page which uses a Standard Set Controller, then use Lightning Out on that page.
  2. I want this Lightning Component to include links which should open in a new tab.

    • The only way I can find to implement this step is to use window.open.
    • I tried out the <lightning:workspaceApi>, but it does nothing in Lightning Out. Nor does it fire any events I could listen for, as far as I can tell.

I read this post, which works well for a "supported" method of navigation in Lightning Out:
How to navigate in lightning out?

However, it does not mention any way to open links in a new tab.

Questions:

Is there a supported way to open a record view (or any page) in a new tab when using Lightning Out? Is there any problem with using window.open, or any risks involved I should know about?

1
  • Workspace API opens a new tab in Lightning console Apps. Its not actually a browser tab. Jan 11, 2019 at 21:08

1 Answer 1

4

I don't see any issues using window.open(). According to Locker API Viewer open is supported.

I have a lightning component that leverages LDS sitting in lighting experience that opens a tableau external report using this method.

Reference: Leveraging Lightning Data Service in Lightning Framework

NOTE: This is my own blog post but the similar code is used for the tableau report!

Based On Comments: Colors highlight the return types of APIs that are secured by the wrapper.

enter image description here

enter image description here

2
  • Just gonna see if any other answers roll in. It's good to see that this particular function is supported, though. Thanks!
    – Adrian Larson
    Jan 11, 2019 at 21:16
  • @AdrianLarson Your welcome. Even I'm curious to see some good answer too! Jan 11, 2019 at 21:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .