You need to sign in to do that
Don't have an account?

Apex:page action attribute limitation??
Hi,
Does any1 have any idea about limitations of the things that can be done from an action method in an apex:page tag
I have an action method in apex:page tag which redirects user to another VF page but its not working.
What I observed that the VF page redirected to other VF page only when the controller of the other VF page was different than its own but when I redirected to a VF page having the same controller its just dint do it!!
I also tried it by switching off the development mode but it dint work. Has nay1 faced any such kind of issue & if so how can some1 resolve it!!
Please check code here.
Try the code given below. It works for two pages having one controller :
public class cls_redirect1
{
Public PageReference PageRefresh()
{
PageReference pr = new PageReference('/apex/testconfirmation');
pr.setRedirect(true);
return pr;
}
}
Hope this helps.
Thanks Pradeep for that. But I want to mantain the controller variables so I cant use setredirect(true). Do you have nay idea how to redirect with setredirect(false) if controller is same as its not redirecting!!
Did you work out how to do this. I have the same issue - the debug logs show I am redirecting to another page (on the same controller) but it does not render it - stays on the same page. Replacing my page reference to www.google.com it does work - so you seem to be right that on the same controller this does not work.
Did you work out a way forward ?
Thanks
Hi,
Nope I still havent got it. NO luck yet!!!!
The below javascript function will let you redirect to another VF page when the variable is true.
window.onload = function() {
if ( {!wantToRedirect} ){
window.location = '/apex/anotherVFpage';
}
}