userlist pagination don't change page

Permalink
hi
i'm using this simple code for list all the user whit pagination but when i click on next the user list is the same.
i've disabled the cache.
<?php
   $lista = new \Concrete\Core\User\UserList();
   $paginazione = $lista->getPagination();
   $paginazione->setMaxPerPage(3);
   $results = $paginazione->getCurrentPageResults();
       foreach($results as $u){
        echo $u->getUserName();
         echo "<br>";
       }
        echo $paginazione->renderDefaultView();
        ?>


any ideas?

 
hutman replied on at Permalink Reply
hutman
Do you have this page in the Full Page Cache? That will prevent your results from updating sometimes.
tkart38 replied on at Permalink Reply
hi
no i've disabled all the chace.

i've solved the problem with this code:
$pagination = $list->getPagination();
            if (isset($_REQUEST[ccm_paging_p])){
               $pagination->setMaxPerPage(2)->setCurrentPage($_REQUEST[ccm_paging_p]);
               }else {
            $pagination->setMaxPerPage(2)->setCurrentPage(1);
            }
            $pages = $pagination->getCurrentPageResults();
            $pagination = $pagination->renderDefaultView();
            $this->set('pagination', $pagination);
         $this->set("pages",$pages);


but i don't know why the normal code for pagination doesn't work.