0
system.debug('wrapper class detail   :' + LstSelectedAlaCarteItem); 
sendother = new PageReference('/apex/EAPQuickStartCreditReport?fname='+fname+'&lname='+lname+'&startdate='+startdate+'&eml='+eml+'&ponumber='+ponumber+'&SelectedAccount='+selectedAccount+'&packagecode='+packagecode);
sendother.setRedirect(true);
return sendother;

LstSelectedAlaCarteItem is a Wrapper. After line 4 this list become empty .

My question is how to pass the wrapper list in PageReference method where i use the list in my controller .

1

If both the pages use the same controller then you can navigate from one to the other by making sure you set the setRedirect parameter to false when returning the page reference for the second page

public PageReference gotoPage2(){
  PageReference pageRef = new PageReference('/apex/Page2');
  pageRef.setRedirect(false);
  return pageRef;  
}

You dont have to pass any page parameters since its the same controller all the controller variables will be accessible once you navigate to the second page.

Put the list 'LstSelectedAlaCarteItem' in a controller variable just so that you can access it in the next page.

public *var type* LstSelectedAlaCarteItem {get; set;}
2
  • Thanks for Reply Now Its going Good. But I want to know How its working? Jun 28 '17 at 4:54
  • @vikasrathi, when you setRedirect as false, it does a client side re-direct and server side controller maintains its view-state. Controller variables get passed from one page to another.
    – RedDevil
    Jun 28 '17 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.