Discovered something about FormHandler's form_generator.pl...

The auto-generated FormHandler code (via *form_generator.pl*) creates submit
buttons like this:
  has_field 'submit' => ( *widget* => '*submit*' );

but that leads to the original error
undef error - Unable to do maketext on: at
/usr/local/share/perl/5.10.0/HTML/FormHandler/I18N.pm line 15

Apparently it should generate the following code instead?
  has_field 'submit' => ( *type *=> '*Submit*' );
That fixes the I18N errors, and it actually works to produce a submit
button. (Note that "type" is used instead of "widget" and "Submit" is
capitalized instead of "submit".)

Is this a canonical goof in form_generator.pl? Or is there something missing
in my environment that's interfering?


Note to googlers -- *form_generator.pl* is really *
HTML::FormHandler::Generator::DBIC*


On Fri, Nov 26, 2010 at 4:48 PM, Alexander Hartmaier <
alexander.hartma...@t-systems.at> wrote:

> Exactly, because the widget class is
> HTML::FormHandler::Widget::Field::Submit and not
> HTML::FormHandler::Widget::Field::submit.
>
> --
> Best regards, Alex
>
>
> On Tue, 2010-11-23 at 19:02 +0100, will trillich wrote:
> > Not sure what your "case sensitive" remark refers to -- and if it's
> > looking for something to be defined XXX that's defined xxx instead,
> > that particular error message is really out of left field.
> >
> >
> > Do you mean something like
> >    has_field 'submit'  => ( widget => 'submit' )
> > should instead be
> >     has_field 'submit'  => ( widget => 'Submit' )
> > with a capital S?
> >
> >
> > The following is definitely working for us now:
> > has_field 'submit' => (type => 'Submit', label => 'Submit',
> > value=>'Submit', required => 0, )
> >
> >
> >
> >
> > On Tue, Nov 23, 2010 at 11:47 AM, Alexander Hartmaier
> > <alexander.hartma...@t-systems.at> wrote:
> >         Perl is case sensitive.
> >
> >         Also you should not have any non Catalyst::Controller
> >         subclasses in the
> >         Controller namespace of your app.
> >         Move you forms to My::App::Form for example.
> >
> >         --
> >         Best regards, Alex
> >
> >
> >
> >         On Mon, 2010-11-22 at 18:25 +0100, will trillich wrote:
> >         > Ooh, very nice! Thanks so much, that's lots better now. Woo
> >         hoo!
> >         >
> >         >
> >         > Yes indeed, the "undef error - Unable to do maketext on:
> >         > at /usr/local/share/perl/5.10.0/HTML/FormHandler/I18N.pm
> >         line 15."
> >         > error has gone away thanks to tweaks to the SUBMIT button on
> >         the
> >         > FormHandler definition.
> >         >
> >         >
> >         > Was there something in the Catalyst/FormHanlder intro that
> >         we missed?
> >         >
> >         >
> >         >
> >         > On Mon, Nov 22, 2010 at 5:16 PM, Hernan Lopes
> >         <hernanlo...@gmail.com>
> >         > wrote:
> >         >         will trillich,
> >         >         that error happens when i use  has_field 'submit'
> >          => ( widget
> >         >         => 'submit' )
> >         >
> >         >         can you test your form with this instead:
> >         >         has_field 'submit' => (type => 'Submit', label =>
> >         'Submit',
> >         >         value=>'Submit', required => 0, )
> >         >
> >         >         i bet your error will go away
> >         >
> >         >
> >         >
> >         >
> >         >
> >         >
> >         >         On Mon, Nov 22, 2010 at 12:19 PM, will trillich
> >         >         <will.trill...@serensoft.com> wrote:
> >         >                 Our form-class includes
> >         >                          has_field 'submit'  => ( widget =>
> >         'submit' )
> >         >
> >         >
> >         >                 Do you mean type=>'submit' instead of
> >         >                 widget=>'submit'?
> >         >
> >         >
> >         >                 Interesting that you'd think of this as a
> >         suspect.
> >         >                 What's the rationale?
> >         >
> >         >
> >         >
> >         >
> >         >                 On Mon, Nov 22, 2010 at 9:16 AM, Hernan
> >         Lopes
> >         >                 <hernanlo...@gmail.com> wrote:
> >         >                         will trilich, are you using widget
> >         type
> >         >                         submit ? try to replace with type =>
> >         'Submit'
> >         >
> >         >
> >         >                         Hernan Lopes
> >         >
> >         >
> >         >
> >         >                         On Mon, Nov 22, 2010 at 1:38 AM,
> >         John Anderson
> >         >                         <geneh...@genehack.org> wrote:
> >         >
> >         >                                 On Nov 21, 2010, at 10:26
> >         PM, will
> >         >                                 trillich wrote:
> >         >
> >         >                                 > Pooh. Still no luck. When
> >         we try a
> >         >                                 more more Moose-y approach,
> >         we do get
> >         >                                 updated database records
> >         (stuffing the
> >         >                                 URL with arguments to affect
> >         a
> >         >                                 form-submit) but still can't
> >         render,
> >         >                                 with the same error as
> >         before:
> >         >
> >         >
> >         >                                 Have you looked at the docs
> >         for
> >         >
> >         HTML::FormHandler::TraitFor::I18N?
> >         >                                 Based on that, you may want
> >         to see if
> >         >                                 you have something in
> >         >                                 $ENV{LANGUAGE_HANDLE} or try
> >         passing
> >         >                                 in a language handle to your
> >         form
> >         >                                 constructor -- or may try
> >         push_errors
> >         >                                 instead of add_errors, as
> >         that
> >         >                                 documentation suggests.
> >         >
> >         >
> >         >                                 j.
> >         >
> >         >
> >         >
> >         _______________________________________________
> >         >                                 List:
> >         Catalyst@lists.scsys.co.uk
> >         >                                 Listinfo:
> >         >
> >         http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >         >                                 Searchable archive:
> >         >
> >         http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >         >                                 Dev site:
> >         >
> >         http://dev.catalyst.perl.org/
> >         >
> >         >
> >         >
> >         >
> >         _______________________________________________
> >         >                         List: Catalyst@lists.scsys.co.uk
> >         >                         Listinfo:
> >         >
> >         http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >         >                         Searchable archive:
> >         >
> >         http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >         >                         Dev site:
> >         http://dev.catalyst.perl.org/
> >         >
> >         >
> >         >
> >         >
> >         >
> >         >                 --
> >         >                 Failure is not important. How you overcome
> >         it, is.
> >         >                 -- Nick Vujicic
> >         >
> >         >
> >         >
> >         _______________________________________________
> >         >                 List: Catalyst@lists.scsys.co.uk
> >         >                 Listinfo:
> >         >
> >         http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >         >                 Searchable archive:
> >         >
> >         http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >         >                 Dev site: http://dev.catalyst.perl.org/
> >         >
> >         >
> >         >
> >         >
> >         >         _______________________________________________
> >         >         List: Catalyst@lists.scsys.co.uk
> >         >         Listinfo:
> >         >
> >         http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >         >         Searchable archive:
> >         >
> >         http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >         >         Dev site: http://dev.catalyst.perl.org/
> >         >
> >         >
> >         >
> >         >
> >         > --
> >         > Failure is not important. How you overcome it, is.
> >         > -- Nick Vujicic
> >         >
> >
> >
> >
> >
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> >         T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
> >         Handelsgericht Wien, FN 79340b
> >
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> >         Notice: This e-mail contains information that is confidential
> >         and may be privileged.
> >         If you are not the intended recipient, please notify the
> >         sender and then
> >         delete this e-mail immediately.
> >
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> >
> >
> >         _______________________________________________
> >         List: Catalyst@lists.scsys.co.uk
> >         Listinfo:
> >         http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >         Searchable archive:
> >         http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> >         Dev site: http://dev.catalyst.perl.org/
> >
> >
> >
> >
> > --
> > Failure is not important. How you overcome it, is.
> > -- Nick Vujicic
> >
>
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



-- 
"The very nucleus of Character: to do what you know you should do, when you
don't want to do it." Stephen Covey
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to