[Catalyst] Catalyst::Plugin::FillInForm

Chisel Wright chisel at herlpacker.co.uk
Thu May 19 12:40:03 CEST 2005


Well I'm making progress in Catalyst-land, and enjoying my journey so
far.

I do have a question or two about Catalyst::Plugin::FillInForm (as the
subject implies).

Basically: How on earth do you get it to fill in forms?!

I've created an app using the following:
[full app attached]

 catalyst.pl FormFill
 cd FormFill
 ./script/formfill_create.pl view TT TT
 ./script/formfill_create.pl controller Form

and made the following modifications:

 lib/FormFill.pm:
   Modify:
     use Catalyst qw/-Debug FillInForm/;


 lib/FormFill/C/Form.pm:
   Modify:
     sub default : Private {
       my ( $self, $c ) = @_;
       $c->stash->{'template'} = 'form.tt';
     }

   Add:
     sub end : Private {
       my ( $self, $c ) = @_;
       unless ($c->res->body) {
         $c->fillform;
         $c->forward('FormFill::V::TT');
       }
     }


 root/form.tt:
   <html>
    <body>
      <form action="" method="post">
        <input name="field1" type="text" />
      </form>
    </body>
  </html>

I then run: ./script/formfill_test.pl /form?field1=XXX
all I see is (excluding usual info/debug output):

<!-- TIMER START: process form.tt -->
  <html>
    <body>
      <form action="/" method="post">
        <input name="field1" type="text" />
      </form>
    </body>
  </html>

<!-- TIMER END: process form.tt (0.000261 seconds) -->

So, what am I doing wrong/stupid?

Also, the documentation for Catalyst::Plugin::FillInForm says:
  Fill form based on request parameters.

Why only request parameters? How do people go about (sensibly)
pre-filling forms with values from, for example, the database.

I'm missing an important point somewhere ...
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FormFill-0.0.1.tar.gz
Type: application/x-tar-gz
Size: 3091 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20050519/cf01a800/FormFill-0.0.1.tar.bin


More information about the Catalyst mailing list