[html-formfu] Problem with form generation/rendering

Will Hawes wdhawes at gmail.com
Fri Oct 5 09:30:47 GMT 2007


On 05/10/2007, Carl Franks <fireartist at gmail.com> wrote:
>
> On 05/10/2007, Will Hawes <wdhawes at gmail.com> wrote:
> > On 04/10/2007, Will Hawes <wdhawes at gmail.com> wrote:
> > >
> > > On 04/10/2007, Carl Franks <fireartist at gmail.com> wrote:
> > >
> > > > On 04/10/2007, Will Hawes <wdhawes at gmail.com> wrote:
> > > > > I'm using the 0.1005 release from CPAN.
> > > > >
> > > > > This script:
> > > > >
> > > > > #!/usr/bin/perl -w
> > > > > use strict;
> > > > > use HTML::FormFu;
> > > > > my $form =3D HTML::FormFu->new;
> > > > > $form->element( 'Text', { name =3D> 'test' } );
> > > >
> > > > That should be either:
> > > >     $form->element('Text')->name('test');
> > > > or:
> > > >     $form->element({ type =3D> 'Text', name =3D> 'text' });
> > >
> > >
> > > Ah, thanks. Should really have guessed the first one as a HTML::Widget
> > user :-/
> > >
> > >
> > > > I'm not sure if I want to investigate why the heck you got such a
> > > > strange output though...
> > >
> > >
> > > It actually behaves itself once I use the correct syntax for
> ->element.
> > Given that the code in SVN didn't display the same behaviour I'd guess
> it's
> > no longer a problem anyway.
> > >
> >
> > Ah, OK, I see what's happening now. I'm testing the CPAN release in the
> > directory tree of a Catalyst app, so the templates are installed at
> > root/formfu/ instead of just root/. Hence the renderer can't see them as
> it
> > just searches root by default. Adding
> >
> > $form->render_class_args( { INCLUDE_PATH =3D> 'root/formfu' } );
> >
> > sorted it, output is now as expected.
> >
> > Would it be feasible to throw an error of some sort, mentioning
> > render_class_args, if the main form template can't be found under
> whatever
> > dir(s) INCLUDE_PATH is set to? The cause of the strange output is less
> than
> > obvious for a newbie and others will undoubtedly fall foul of this
> problem
> > in future.
>
> That's already in the issue tracker:
> http://code.google.com/p/html-formfu/issues/detail?id=3D14
>
> It now just needs to be done :)


I've just noticed a caveat explaining why I got the weird output. I've added
it to issue tracker.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20071005/05=
c185d4/attachment.htm


More information about the HTML-FormFu mailing list