2

I am using e.force:refreshView in order to refresh a custom component and it does not seem to be working. I am firing it when a flow finishes (that categorizes uploaded files) but the component does not refresh at all. Here is some of the relevent code

controller

handleFlowFinish: function(component, event, helper) {
    helper.fireRefresh(component, event, helper);

    console.log("It Fired!")
}

Helper

fireRefresh : function (component, event, helper) {
    $A.get('e.force:refreshView').fire();
    console.log("Triggered Sucessfully")

}

I originally had it in the Controller but thought it might make sense to fire it from the helper. Either way it does not refresh the component. Both Console.logs log through so the functions themselves are being fired

I can include more code if necessary but with th fact the both above functions trigger without issue it doesn't seem like it would add anything

1

As a workaround, you can call the init method once again which can re-fetch the data of an uploaded file and for any other records use caching. Make sure it does not go into a loop.

controller

handleFlowFinish: function(component, event, helper) {
    helper.fireRefresh(component, event, helper);

    console.log("It Fired!");
    var a = component.get('c.init');
    $A.enqueueAction(a);
}
  • 1
    Shouldnt loop in my situation as the flow is triggered by a user click and the init just retrieves displayed data so that should work. thank you – Bobbygllh Mar 31 at 12:54
1

From my experience, $A.get('e.force:refreshView') only updates the standard components on the current lightning page. For example, if you're on a record page and have a custom component that updates record data, then using the e.force:refreshView will pull in the new values on the Record Details standard component.

As mentioned by @VivekMakkar, anytime you want to refresh content on your own lightning components, you need to handle that manually yourself.

  • 1
    I did not realize that it only updates the standard components but that would make a lot of sense. appreciate it – Bobbygllh Mar 31 at 12:50

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.