Problem with pagination and $limitstart

425 views
Skip to first unread message

tomfuller

unread,
May 6, 2012, 6:42:54 PM5/6/12
to joomla-de...@googlegroups.com
My component's list model is no longer providing a $limiststart or $start to the model using JModelList

You can see if working at www.joomlabiblestudy.org - http://www.joomlabiblestudy.org/jbsexamples/studies-list.html

Try to paginate through the list - in the link at the bottom the correct $start value is displayed but ignored in the model. This also happens if a filter is applied.

In the model I have this code:

$value = JRequest::getUInt('start', 0);
$this->setState('list.start', $value);

$value correctly gets the $limitstart or $start from JRequest, but when I dump $this->state from the view.html.php $start is always at 0 and the list does not ever go beyond page 1 of the results.

Am I forgetting something?

If you need more code I can supply in response.

Tom

tomfuller

unread,
May 8, 2012, 7:02:33 PM5/8/12
to joomla-de...@googlegroups.com
An update. I can get the model to work but only in sef mode.

I made this change to the populateState() function:

 parent::populateState('study.studydate', 'DESC');
          
      
        $value = JRequest::getUInt('start');
        $this->setState('list.start', $value);

I had to put the parent:: statement first, which doesn't make any sense. The $limit variable seems to be filled by Joomla automatically. But if I take out the 'list.start' then it doesn't even work in sef mode.
Reply all
Reply to author
Forward
0 new messages