• Ankita Rustagi 11
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I'm using e.force:navigateToURL for clickable links in my lightning component. I have tried several different ways of creating this url. I need it to open the links in a new tab so that the original window remains open. 

When the links are clicked, it opens the URL in a new window (as expected), but it's also changing the original window's URL. How do I prevent this from happening?

Here is my function:
 
handleClick : function(component, event, helper) {  
        var baseURL = component.get("v.cbaseURL");
        var viewRecordEvent = $A.get("e.force:navigateToURL");
        viewRecordEvent.setParams({             
             "url": window.open(baseURL+'/'+ event.target.id,'_blank')              
       });
       viewRecordEvent.fire();
    }
Here are some screenshots showing the behavior.

Lightning component with clickable link:
User-added image

New tab that is opened:
User-added image

Original tab (after clicking link):
User-added image
Hi,

 I am working on one of the requirement where I am receiving JSON string in the response. I am confused whether to use JSON Parser or JSON Deserialization. Can someone provide some details about these 2 methods to extract the value from JSON string. 

Thanks,
  Vishnu