0

I have a custom lightning page which has two lightning components and 2 visualforce pages. In the lightning components whenever any changes being done I have used the force:refreshview event getting fired so that the new value can be seen on the screen. Even though the refreshview event fired but I don't see the VF getting loaded again with the new values. It still contain the old one which was there at the time of loading the page.

Any idea why ? is their any way to refresh the entire lightning page (though it will be slow) but I open to other ideas if any?

  • You can try window.location.reload – Avijit Chakraborty Jun 17 '18 at 20:16
  • VF pages are inside lightning component? Or components inside another vf page (lightning.out)? – patryk Jun 17 '18 at 20:31
  • VF pages are not inside lightning component. its a standalone VF page in the lightning page. – Abhik Dey Jun 18 '18 at 5:34
  • @AvijitChakraborty: I had tried location reload, parent.location.reload. window.location.href, it didn worked – Abhik Dey Jun 18 '18 at 5:35
2

I had the same issue and the easiest way to achieve this is instead of refreshing the view just simply redirecting to the same page. My helper method:

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

Unlike refreshView this will refresh VF inside. With new URL format you can just pass it like /mypage

  • I will try this – Abhik Dey Jun 22 '18 at 13:39

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.