About a week or so I posted about getting sticky form elements,
and was pointed to the CGI plugin. Since then I've been setting
up a bunch of templates and learning my way around TT programming,
and it's been going well.

However, today I actually tried to use form stickiness, and I 
find that I can't retrieve parameters at all. I'm sort of mystified
by this, esp. since the part that isn't working is effectively
identical to what I had before, except using TT instead of CGI.pm.
With the understanding that I'll probably realize my mistake as 
soon as Mutt sends this message, can someone please give me a
hint?

In my calling program, I retrieve values from a database into
a $data_ref hash, and insert them into the parameter space with:

  foreach my $key (keys(%$data_ref)) {
    CGI::param(-name => $key, -value => $data_ref->{$key});
  }

Later I call $tt->process..., and my page, including forms,
appear, but empty aside from the defaults, with no sticky
values held therein. Indeed, when I try for debugging purposes
to print a parameter value anywhere, i.e.

[% USE CGI %]
...
<body>
[% CGI.param("title") %]

it returns nothing, suggesting that the parameter isn't being
picked up at all, not just that it's a stickiness problem.
(Also for testing, if I try adding "print STDERR CGI::param("title");"
immediately before the $tt->process call, the value of "title" 
does appear in STDERR.)

In passing, I also note that if I try to use the params() method,
as the Template::Plugin::CGI docs describe, by doing something
like [% CGI.params.title %], I die with an "undef error - 
Undefined subroutine CGI::params" error.

Thanks for any insight.

Jesse Sheidlower

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to