On Wednesday June 9 2004 10:12 am, you wrote:
> On Wed, 9 Jun 2004, Greg Jetter wrote:
> > 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/lib/perl5/site_perl/5.8.0/HTML/Pager.pm line 421.
> >
> > any thoughts as to why ?
>
> My guess would be that get_data_callback returned something that isn't
> an array ref. ;)
>
> > could it have to do with the last set of data not containing full
> > set of rows ?
>
> If that triggers a bug in your code, sure!
>
> > I can post code if it would make things clearer ..
>
> Please do. But keep it short!
>
> -sam
here's the code I'm using to call the paging stuff
the array has 81 items , the first 80 display correctly , when page 9 , which
should contain the last item is called the error is generated.
@data_record contains 81 member array of hashs refs.
# snip
my $rows = @data_record; # get the number of rows
my @array =("Class",
"Price","Street_Name","Bedrooms","Bath","Size","Garage_Size","Lot_Size","Special_Features",
"View","city","state","county" );
my $array = [EMAIL PROTECTED] ;
my $get_data_sub = sub {
my ($offset, $rows) = @_;
my @return_array;
for (my $x = 0; $x < $rows; $x++) {
push(@return_array, $data_record[$offset + $x] );
}
return [EMAIL PROTECTED];
} ;
# create a Pager object
my $pager = HTML::Pager->new(
# required parameters
query => $q,
template => $tmpl,
get_data_callback => $get_data_sub,
rows => $rows,
page_size => 10 ,
persist_vars => [EMAIL PROTECTED] ]
);
# make it go - send the results to the browser.
print $q->header();
print $pager->output;
Any help would be nice , what puzzles me is why it would work for the first
80 records and then through an error.
I also tried it on several diffrent record sets , one with less that 50
records and one with more than 300 , in each case the last page acts the
same , the pageing works fine untill the last page is called then it fails
with the " get_data_callback returned something that isn't an array ref! "
message
Help
Greg
-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users