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
Sfdc learner18Sfdc learner18 

How to do a sorting on Transient variable using pagination

Hi Experts,

I was getting a error "Exceeded view state " in my Visualforce page so the list variable  i mentioned as transient the error is gone now.But the problem is the sorting is not working ..My code is very big so i cant post it here.It would be very useful if someone give some idea to solve this and make the sorting work,


Thanks!!
Raj VakatiRaj Vakati
Why can't you use the javascript datatable to do sorting etc .. ?? 
You can able to use remove actions or remote functions ..? 

or simple you can get the data once by using the apex controller and do the sorting etc by using the datatable js 

http://sfdcsrini.blogspot.com/2016/04/jquery-data-tables-in-visualforce-pages.html
https://www.forcetalks.com/blog/how-to-use-jquery-datatable-plugin-in-salesforce-lightning-component/ 

 
SandhyaSandhya (Salesforce Developers) 
Hi,

Try using the word static as static variables are not transmitted as part of the view state.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm?search_text=Static
 
https://salesforce.stackexchange.com/questions/190970/when-to-use-static-variables-in-apex-controller
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 
Sfdc learner18Sfdc learner18
Hi Raj,

Thanks for the reply...Do you mean this javascript datatable sorting can be used with transient list variable?
Sfdc learner18Sfdc learner18
Hi sandhya,

Thanks for the reply.With static variable will my commandlink call the apex method where i am doing the sorting?With transient list if i click on the commandlink its not calling the action method itself.


Thanks,
Lahari