function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
shrey.tyagi88@tcs.comshrey.tyagi88@tcs.com 

Load URL in Modal Window -Lightning

Hi Everyone,
     I have a lightning component (a button on record detail page) that opens a new window when clicked. I want the new window to open in the modal window instead of a new tab. Can anyone help me with the code given below?

Lightning Component:

<aura:component controller="Utils" implements="force:lightningQuickAction,force:hasRecordId">
    <iframe width="720" height="480" scrolling="yes" src="https://www.google.com/"></iframe>
    <aura:attribute name="recordId" type="Id" />
    <aura:handler name="init" value="{!this}" action="{!c.openActionWindow}"/> 
</aura:component>

Lightning Controller:

({
    openActionWindow : function(component, event, helper) {
        var oppId = component.get("v.recordId");
        var action = component.get("c.ActiveSessionId");
        var returnURL = $A.get("$Label.LightningDocUploadRetURL");
       action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
              var tempVars = response.getReturnValue();
              var urlEvent = $A.get("e.force:navigateToURL");
                 urlEvent.setParams({
                 "url": 'http://webservicesstage.rti.org/OnBaseUpload/?Type=Opportunity&sessionId='+tempVars+'&recordId='+oppId
                });
               urlEvent.fire();
            }
        });
        
    $A.enqueueAction(action);
        

    } ,
    

    
})
Now instead of google.com I want the URL to go in that iframe. Can anyone help??