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
amoldavskyamoldavsky 

Page parameters get lost on refresh

Hey,

 

I have a method in my controller that returns PageRerence to itself. However, when I submit a form what it attached to this method I get a page refresh but the URL parameters are lost...

 

Code in the controller method:

public PageReference login() {
	return ApexPages.currentPage();
}

The original url when I open that page for the first time:

https://zoominfodev.na14.visual.force.com/apex/zoominfodev__login?inline=1&callbackUrl=%2Fapex%2Fzoominfodev__ZoomAccountProfile%3Fid%3D001d000000Ctfjl%26inline%3D1%3Fid%3D001d000000Ctfjlinline%3D

 The url after I submit the form (the method login() executed):

https://zoominfodev.na14.visual.force.com/apex/login

 

Same goes for cookies, if I set Cookies on the currentPage() and then return it, I lose them after the refresh.

 

Any ideas what I'm doing wrong?

 

Thank you!

-Assaf

Andy BoettcherAndy Boettcher

Why would you refresh your page instead of doing a rerender of sections?  Odds are you'll have to set all of your parameters before returning the PR.

 

-Andy

amoldavskyamoldavsky

I would not want to do that because then I would have to have every page composed of multuple pages each separated with render="true/false". Does not sounds a like a good design idea.

 

We have a login screen that creates a session to our external platform and stores that in a cookie, if the user is missing the cookies I have to bounce the user around. I would not want to enclose the login page code within a section on each page (Leads, Accounts, Contacts).