1

Can we open the component in a new url on button click?

fileUpload is another component that has to be opened in a different tab.

 <ui:button class="slds-button slds-button--neutral cuf-publisherShareButton qe-textPostDesktop WIDE uiButton--default uiButton--brand uiButton" 
          label="Click to Upload File" press="{!c.gotoURL}"  />

 gotoURL : function (component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
        "url": "skbteqforce:fileUpload"
    });
    urlEvent.fire();
}

1 Answer 1

2

I think navigateToComponent is more suitable than navigateToURL:

navigateToMyComponent : function(component, event, helper) {
    var evt = $A.get("e.force:navigateToComponent");
    evt.setParams({
        componentDef : "c:myComponent",
        componentAttributes: {
            contactName : component.get("v.contact.Name")
        }
    });
    evt.fire();
}
0

You must log in to answer this question.

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