Hello,

I had some code that generated loop data with the typical 
...
push (@loop, \%row_data);


Now I want to use HTML::Pager, so I added:

my $get_data_sub = sub {
    my ($offset, $rows) = @_;
    my @return_array;
    for (my $x = 0; $x < $rows; $x++) {
        push(@return_array, $loop[$offset + $x] );
    }
    return \@return_array;
};

my $pager = HTML::Pager->new(query => $q,
                             get_data_callback => $get_data_sub,
                             rows => $rows,
                             page_size => 8,
                             template => $template
                            );

print $pager->output;

which seems to work fine, *except* if the last page has only one row, I
get:

get_data_callback returned something that isn't an array ref!  
You must return from get_data_callback in the format 
[ [ $col1, $col2], [ $col1, $col2] ] 
or 
[ { NAME => value ... }, { NAME => value ...} ]. 
at /usr/local/lib/perl5/site_perl/5.6.1/HTML/Pager.pm line 421.


Can anyone see the problem(s)?

Thanks,
Andrew


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to