You need to sign in to do that
Don't have an account?
Varun99
Pagereference
Hi,
In my visualforce page displayed records with pagination and "edit" command link when i click on edit button
it will go to standard record edit mode when i cancel/save it will back to current page number but i have back to first page number.how to pass page number in pagereference?
Can any one help me?
Thank you
Hi Varun,
You can use a controller variable to store the page number.
If you are using the action function you can update the variable by passing the value in param.
state will be name of your controller variable.
or simply you can store a value in hidden field and extract that value in your controller using
ApexPages.currentPage().getParameters().get('id').
make sure you have the hidden field inside the same form tags.
Hi Mudasir,
Thanks for your reply. Am passing id like
public void editrecord()
{
string bookingid= ApexPages.currentPage().getParameters().get('bookingid');
string aaaa=ApexPages.currentPage().getParameters().get('id');
PageReference page;
Page = new PageReference('/'+bookingid+'/e?retURL=/apex/bookingstatus?id='+aaaa);
return Page;
}
here bookingid is current edit recordid but it return to first page number but not previous page number
my url like
https://c.ap1.visual.force.com/apex/bookingstatus?id=null
Can u help? where am mistake?
Hi Varun,
Use the following code.
PageReference page = new PageReference('/'+bookingid+'/e?retURL=/apex/bookingstatus?id='+aaaa);
page.setRedirect(true);
return page;
Regards,
Mudasir.