CListView inside a CActiveForm

I want to create a quiz with pagination. Therefore, I have the following structure:

<?php $form=$this->beginWidget('CActiveForm', array(






)); ?>

				<?php $this->widget('zii.widgets.CListView', array(





				)); ?>

<?php $this->endWidget(); ?>

Look at the image and you will understand better the situation:



The problem is, when I click on a page number, the answers are not sent. I tried with the following jQuery but it’s not working:




Any ideas?


$('.page a').click(function(){



this doesn’t work. In fact, the following “alert” works:





It would help to know what is actually being send. Without that info an educated guess might be to try:



      return false;


it worked!

Now I have another problem. In the controller, I collect the POST data like this:

		$this->paramKeys = array_keys($_POST);

		$this->paramValues = array_values($_POST);

		$i = 0;

		foreach($this->paramKeys as $paramKey)


			Yii::app()->session[$paramKey] = $this->paramValues[$i];



If I set some answers and I click the same page number, the answers are set (this is correct). However, if I set some answers, click another page number and return back to the previous page, the answers are not set! Maybe this problem is related to sessions, since the variables of the session seem to disappear. I tried with $_SESSION but it happens the same.

You will have to take a look at your _view.php view and probably have to rewrite it to take the session parameters when set.

I already take the session parameters at my _view.php. Look:

<div style="border:1px solid black;margin:10px;padding:10px;">


		echo CHtml::encode($data->title);




		echo CHtml::radioButtonList($data->id, Yii::app()->session[$data->id], array(0 => 'false', 1 => 'true'));



Finally I solved the problem creating a temporary table. But does anyone know why I can’t use sessions?