<font size=2 face="sans-serif">That was the clue I needed. There are a
few pieces to this that I could not find all in one place. Here is working
code for the next poor person trying to get this working:</font>
<br>
<br><font size=2 face="sans-serif">sub list :Local {</font>
<br><font size=2 face="sans-serif"> my
($self, $c, $page) = @_;</font>
<br><font size=2 face="sans-serif"> #needed
to add $page to the param array</font>
<br><font size=2 face="sans-serif"> $page
= $c->req->param('page') || 1;</font>
<br><font size=2 face="sans-serif"> #then
you either get the value from the query or set to 1. I removed the "my"
as this is declared above.</font>
<br><font size=2 face="sans-serif"> my
$rs = $c->model('ORANGES::AccountView')->search_rs(undef, { </font>
<br><font size=2 face="sans-serif">
order_by => 'account_code',</font>
<br><font size=2 face="sans-serif">
rows => 15,</font>
<br><font size=2 face="sans-serif">
page => $page,</font>
<br><font size=2 face="sans-serif"> #I
changed this back to use the variable</font>
<br><font size=2 face="sans-serif"> });</font>
<br><font size=2 face="sans-serif"> $c->stash(accounts
=> $rs);</font>
<br><font size=2 face="sans-serif"> $c->stash(pager
=> $rs->pager());</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">and now it works!</font>
<br>
<br><font size=2 face="sans-serif">Thanks all. I will be back.<br>
</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Cory Watson <jheephat@gmail.com></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">The elegant MVC web framework <catalyst@lists.scsys.co.uk></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">04/27/2012 03:20 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Catalyst] Paging problem</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Alex Povolotsky wrote:<br>
> On 04/28/12 00:05, Kenneth S Mclane wrote:<br>
>><br>
>><br>
>> ok, I tried this:<br>
>><br>
>> my ($self, $c, $page) = @_;<br>
>><br>
>> and my template code is issueing uri's like this:<br>
>><br>
>> </font></tt><a href="http://localhost:3000/accountview/list?page=4"><tt><font size=2>http://localhost:3000/accountview/list?page=4</font></tt></a><tt><font size=2><br>
>> <</font></tt><a href="http://localhost:3000/accountview/list?page=4"><tt><font size=2>http://localhost:3000/accountview/list?page=4</font></tt></a><tt><font size=2>><br>
>><br>
>> Do I need to remove this line:<br>
>><br>
>> my $page = 1;<br>
> It depends on what do you need. If you want paging to work, you'd
better<br>
> don't hardcode 1st page.<br>
<br>
Kenneth,<br>
<br>
Note that parameters come from the request:<br>
<br>
my $page = $c->req->param('page') || 1;<br>
<br>
The form you suggested would be if you were using a page in the path <br>
(/accountview/list/4) rather than in the query params <br>
(/accountview/list?page=4).<br>
<br>
hth.<br>
<br>
<br>
-- <br>
Cory G Watson<br>
</font></tt><a href=http://www.onemogin.com/><tt><font size=2>http://www.onemogin.com</font></tt></a><tt><font size=2><br>
<br>
<br>
_______________________________________________<br>
List: Catalyst@lists.scsys.co.uk<br>
Listinfo: </font></tt><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"><tt><font size=2>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</font></tt></a><tt><font size=2><br>
Searchable archive: </font></tt><a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/"><tt><font size=2>http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</font></tt></a><tt><font size=2><br>
Dev site: </font></tt><a href=http://dev.catalyst.perl.org/><tt><font size=2>http://dev.catalyst.perl.org/</font></tt></a><tt><font size=2><br>
<br>
</font></tt>
<br>
<br>