Remembering list checkbox values between pages


I have a standard list view containing data from a model. I added an additional check box input field to each row on the list view (this checkbox value is not part of the model). Is there a simple/clean way using Yii to remember any rows which I tick, so that if if I move to another page and then return to the original page the ticked rows are still displayed.

Thanks for any help you can give.


Store the selection in a session variable.

Sorry I am not a php expert, so could you give me more info on how the data would be placed in/retrieved from the session between clicking next/previous pages. I want a simple solution that doesn't involve major changes to a standard list view.


When you collect the selection, you can store it in session using $_SESSION['selection']=xxx

Then, in your other pages, in order to retrieve the selection, you access $_SESSION['selection']

Yes I understand that, but what triggers the placing of the data in the session, when the user clicks on one of the pagination links. There is no code in the view which allows me to hook into the pagination links just the standard pager widget

<?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>


It should probably happen on form submission.  Eg the action in the controller, if the data validates.