7

I have a lightning component in it's own page in Salesforce1 that allows me to click through to the standard Salesforce opportunity page. (The component currently just shows basic Opportunity information.)

In the standard Opportunity page I can change values in the opportunity and save the new values. I then click the back button and Salesforce1 correctly navigates back to the lightning component.

The issue I seem to get a stale version of the Opportunity as the new values do not show on the component.

Is there way to refresh the component on navigating back?

I tried hooking in a doneRendering listener but that does not get called on the back navigation. Is there another event I can subscribe to within the lightning component?

Thanks

  • I'd recommend trying window.opener.location.reload() to see if it resolves your issue – Gaurav Kheterpal Feb 13 '15 at 3:25
3

You could try firing force:refreshView during an aura:locationChange event. Add the locationChange handler to your component.

<aura:handler event="aura:locationChange" action="{!c.update}"/>

And handle the event in your JS code.

 update : function (component, event, helper) {
    // Get the new location token from the event if needed
    var loc = event.getParam("token");
     $A.get('e.force:refreshView').fire();
}

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_aura_locationChange.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.