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
Ishan K SharmaIshan K Sharma 

Two VF pages sharing one controller, data not available in second VF(renderas pdf) page.

Hi

 

I have two vf pages sharing one controller.one is vf page and other is vf page(renderas pdf). 1st vf page search and show some records with checkbox.  On the basis selected records a pdf generates which is my 2nd vf page . pdf page also uses  instance variables of controller to show dynamic values in it. Now i am saving this generated pdf to NOTES & ATTACHMENTS of some specific object.

I am able to save it but all Dynamic values are not available in notes and attachments.Only hardcoded valus are available

 

I think it is related to binding i.e my constructor is calling 2 times and thatswhy all the selected records wash away. Pdf generates when constructor calls 2nd time .I am not able to bind it.

Please suggest some solution.

 

Tkanks

Ishan Sharma

 

 

liron169liron169

Hi,

 

Each page have its own instance of controller, so the selected records from the first are not visible to the second.
This means that you will need to marks the selected records in some way.


Some ideas:
1.Update field (checkbox) on those records from the first page, and then in the second retrieve the records base on that field.
2.Pass in the URL the IDs of selected records and in the second page use retrieve records base on that IDs.