You need to sign in to do that
Don't have an account?
E.J.R
Embedded VF page on Lightning not redirecting the same as in Classic (screenshots included)
I've searched hours for a solution or even just someone with the same problem, to no avail. Any help would be greatly appreciated. To illustrate the problem, I've created a very simple test.
In SF Classic, I added a home page component to the home page layout, like so:
When I click the "Edit" button, the iframe redirects to a new page (the only difference being a GET parameter I add to the URL called "edit"). You can see the address bar in both screenshots holds the same URL. The page itself does not reload, just the iframe.
Now I want this same behavior to happen on Lightning Experience. To start, I add the VF page as a component within the Lightning App Builder, and here's the initial result:
After clicking "Edit", the entire page gets redirected (rather than just the iframe), as seen below:
I'm brought to a completely new page altogether. How can I prevent this from happening? I want the iframe to reload seamlessly, while remaining on the home page.
VF Page:
Controller:
In SF Classic, I added a home page component to the home page layout, like so:
When I click the "Edit" button, the iframe redirects to a new page (the only difference being a GET parameter I add to the URL called "edit"). You can see the address bar in both screenshots holds the same URL. The page itself does not reload, just the iframe.
Now I want this same behavior to happen on Lightning Experience. To start, I add the VF page as a component within the Lightning App Builder, and here's the initial result:
After clicking "Edit", the entire page gets redirected (rather than just the iframe), as seen below:
I'm brought to a completely new page altogether. How can I prevent this from happening? I want the iframe to reload seamlessly, while remaining on the home page.
VF Page:
<apex:page controller="TestRedirect"> <apex:pageBlock > <apex:pageBlockButtons location="top"> <apex:form > <apex:commandButton action="{!test}" value="Edit" /> </apex:form> </apex:pageBlockButtons> </apex:pageBlock> <apex:outputPanel rendered="{!editing}"> Editing </apex:outputPanel> </apex:page>
Controller:
public class TestRedirect { public Boolean editing {get;set;} public TestRedirect() { editing = ApexPages.currentPage().getParameters().get('edit') == 'true'; } public PageReference test() { PageReference pageRef = Page.TestRedirect; pageRef.getParameters().put('edit', 'true'); pageRef.setRedirect(true); return pageRef; } }
I am trying to reproduce this in my org and will share more inputs as I have.
In the meantime, can you let me know if you have force:navigateToComponent event in your lightning code?Thanks
Thanks for the reply. I'm not actually using any lightning code, just a simple visualforce page. My entire test was run using the code above, nothing else.
I'm having the same issue