Hi all, it's me again,

I'm having a problem using class::dbi pagers and the Template Toolkit.

I have a data model built with Class::DBI and am using the
TemplateToolkit via cap::Plugin::TT for my views.

My baseclass for my models uses Class::DBI::Pager.

In my run mode, I do something like this:

my $pager = Foo::DB::Moose->pager( $per_page, $page);
my $meece = $pager->retrieve_all;

$params->{pager} = $pager;
$params->{meece} = $meece;

and I'm using a template that looks like this:

Entries: [% pager.total_entries %]

[% WHILE (moose = meese.next) %]
   name: [% moose.name %]
   color: [% moose.color %]
[% END %]

and I'm having a problem.  None of the methods on the pager object
appear to work, although the meese iterator works correctly.

If I add this to the perl side:

$params->{ape} = $pager->total_entries;

I can see the expected value for ape in the template.

I've also logged the Data::Dumper output for $pager to a file, and
it's a perfectly reasonable perl object.

When I used DevPopup and TT to check out the parameters that I'm
passing to the Toolkit, I see this:

$Params1 = {
             'c' => 'Object:PathComp::WebApp',
             'current_page' => '3',
             'page_title' => 'Browsing Gene Interaction',
             'geneis' => 'Object:Class::DBI::Iterator',
             'pager' => 'Class::DBI::Pager=HASH(0x8b6c49c)'
           };

Which strikes me as odd.  Why does it report that pager is a hash,
whereas the others appear to just be the name of my object classes.

Could this be the root of my problem?

Any other suggestions?

Thanks,

g.

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to