I have the following data
$dp = new CArrayDataProvider($message->message->replies, array('pagination' => array('pageSize' => 5, ),));
Now, i use it in the following CListView
$this->widget('zii.widgets.CListView', array(
'viewData'=>array('mode'=>$mode),
'dataProvider'=>$dp,
'pager' => array(
'prevPageLabel'=>'< Anterior',
'nextPageLabel'=>'Siguiente >',
'header'=>'Pagina: ',
'pageSize'=>5,),
'itemView'=>'_completeMessageView',
'emptyText'=>'No ha recibido ningun mensaje todavia',
'enablePagination'=>true,
'id'=>'listReplies',
));
?>
Although the pagination does appear, my problem is that when i try to change the page i’m on, a POST is generated: http://localhost/ElSuperDTUser/index.php/messages/displayMessage?page=2
and my page goes blank. This is because in my controller, the displayMessage action is defined like this:
public function actionDisplayMessage(){
if(isset($_POST['message_id']) & isset($_POST['mode'])){
...
}
}
And of course, when the post is generated it doesnt enter the action because of the if condition. So, my first option is send extra POST values for the message id and the mode. How can I specify extra post parameters to be sent when the page is changed? I tried ajaxUrl with no luck.
The other option i thought of was to display the page whether the post variables are set or not, but i can’t do that because the page needs of those two values.
Help is very much appreciated. Thanks!