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
Marco_____Marco_____ 

Page reference with VF included in Page Layout

I've created a VF page with a standardcontroller (User) and 1 extension

the extension is doing a pagereference after an action to move to another page.

            pagereference MyPage=  new PageReference('http://www.google.com');
            MyPage.setRedirect(true);
            return MyPage;

 

this VF page is inside the Page layout and it only works inside the iframe.

I would like to redirect the full frame to my page.

 

Any idea?

Best Answer chosen by Admin (Salesforce Developers) 
Kirtesh_JainKirtesh_Jain

Hi ,

 

I think you first should come to javascript on oncomplete event .

then where you should write code like 

 

window.opener.location = "http://www.google.com" ;

 

Thanks.

Kirtesh

All Answers

Edwin VijayEdwin Vijay

What is the action you are using?

 

If you're using commandlink or commandbutton use target="_parent" as an attribute. Hope you are not using a frame within a frame

Kirtesh_JainKirtesh_Jain

Hi ,

 

I think you first should come to javascript on oncomplete event .

then where you should write code like 

 

window.opener.location = "http://www.google.com" ;

 

Thanks.

Kirtesh

This was selected as the best answer
Marco_____Marco_____

i've used the oncomplete event successfully.

<apex:commandbutton value="do it" action="{!doIt}" oncomplete="window.top.location={!newUrl}"/>

 

My controller:

Void doIt(){

....

newURL= object__c.id;

}

 

A big thanks to Kirtesh

Message Edited by Marco_____ on 06-26-2009 03:03 AM