function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
E.J.RE.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:

User-added image

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.

User-added image

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:

User-added image

After clicking "Edit", the entire page gets redirected (rather than just the iframe), as seen below:

User-added image
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;
    }
}
SwethaSwetha (Salesforce Developers) 
HI E.J.R ,
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
 
E.J.RE.J.R
Hi Swetha,

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.
Bill Gravelle SABill Gravelle SA
Did you ever find a solution for this?

I'm having the same issue