I have done this successfully now. I am not sure if this is the correct way to do it or not.
I was actually trying to follow lendr tutorials. But he has not provided working code in the master repository of git for the example.
I have put these two lines in my model which is extended from JModelBase
$this->limit = $this->_app->getUserStateFromRequest('limit', 'limit', 10, 'int');
$this->limitstart = JRequest::getVar('limitstart', 0, '', 'int');
and my getPagination() method in the model class is as below
function getPagination(){
// Lets load the content if it doesn't already exist
if ($this->_pagination == null || empty($this->_pagination)){
$this->_pagination = new JPagination($this->getTotal(), $this->limitstart, $this->limit );
}
return $this->_pagination;
}
After doing this i only have put $this->pagination = $model->getPagination() in my view which is extended from JViewHTML
And then in the template I have put $this->pagination->getListFooter();
Now its working correctly for me.
But I am not sure how the state can be used in this case, as it looks like its altogether missing from my implementation. Will see how i can achieve that too.
Thanks for you reply Viper.