Subject: | Wishlist: less coupling of functionality to HTML display |
Hello,
I'm interested in using HTML::Pager to build some web pages that will be XHTML 1.0 compliant. However, even if I use my own template the <input> tags generated by PAGER_NEXT and PAGER_PREV won't be compliant. Below is a patch to address that. It creates new variables that just provide just the bare JavaScript call, which can be attached to anything.
However, what I would really like is a solution that doesn't use JavaScript at all. Why not just use a solution like Google that passes values like "start=10" to the script? I've done that on custom paging systems I've written and it works well.
Mark
--- /usr/local/lib/perl5/site_perl/5.8.0/HTML/Pager.pm Fri Apr 14 11:05:43 2000
+++ /usr/home/mark/tmp/Pager.pm Thu May 1 15:54:06 2003
@@ -480,6 +480,7 @@
if (($self->{offset} + $self->{page_size}) < $self->{rows}) {
my $next_offset = $self->{offset} + $self->{page_size};
$template->param('PAGER_NEXT', "<INPUT TYPE=BUTTON VALUE='Next Page' onClick=\"PAGER_set_offset_and_submit($next_offset);\">");
+ $template->param('PAGER_NEXT_JS', qq!onClick="PAGER_set_offset_and_submit($next_offset);"!);
}
if ($self->{offset} > 0) {
my $prev_offset = $self->{offset} - $self->{page_size};
@@ -488,6 +489,7 @@
}
;
$template->param('PAGER_PREV', "<INPUT TYPE=BUTTON VALUE='Previous Page' onClick=\"PAGER_set_offset_and_submit($prev_offset);\">");
+ $template->param('PAGER_PREV_JS', qq!onClick="PAGER_set_offset_and_submit($prev_offset);"!);
}
# generate jump zone