Grokbase
Topics Posts Groups | in
x
[ help ]

[html-formfu] non-processing actions, WAS: Date element stopped working

View TopicPrint | Flat  Thread  Threaded
1) Carl Franks ah, the problem is that you're setting the default() after the FormConfig action calls...
| +1 vote (Anchor)
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
On 25/03/2008, vti <viacheslav.t@gmail.com> wrote:
>
> I created sample Cat app and behaves the same as my app. Sorry for the name, but
>  it is what I fill now :)

ah, the problem is that you're setting the default() after the
FormConfig action calls $form->process.

If you make any changes to the form, you need to add a
$form->process() before returning from the action subroutine.

What would be ideal - and I think has been discussed before - would be
a FormConfig action that doesn't automatically call process() - as it
can be an expensive and possibly destructive method to call twice.

I think I was initially worried about an explosion of action names, as
we already have:
    Form
    FormConfig
    FormMethod
    MultiForm
    MultiFormConfig
    MultiFormMethod

Adding non-processing actions would immediately double that number.

Maybe something like
    FormConfig('process=0')
    FormConfig('config-file', 'process=0')
would be better than adding new action names.

It might get hairy handling all possibilities though, as the
attributes don't really support multiple arguments, so we'd have to
parse the strings ourselves.
fex, with the above example we'd actually get something like:
    $VAR1 = "config-file\', \'process=0"

Carl

_______________________________________________
HTML-FormFu mailing list
[email protected: HTML-F...@lists.rawmode.org]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
2) Zbigniew Lukasiak I know this will sound extreme, but frankly, I would just entirely scratch the whole...
| +1 vote (Anchor)
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
I know this will sound extreme, but frankly, I would just entirely
scratch the whole Catalyst::Controller::HTML::FormFu and leave it only
as a POD describing the available integration possibilities.  There is
rather not much of code there and with so many options it is spread
very thin.

And additionally multiple inheritance causes no end of problems - so
it is advisable to avoid forcing users to 'use base' to use your
library.

Cheers,
Zbigniew


On Tue, Mar 25, 2008 at 2:45 PM, Carl Franks <fireartist@gmail.com> wrote:
> On 25/03/2008, vti <viacheslav.t@gmail.com> wrote:
>  >
> > I created sample Cat app and behaves the same as my app. Sorry for the name, but
>  >  it is what I fill now :)
>
> ah, the problem is that you're setting the default() after the
>  FormConfig action calls $form->process.
>
> If you make any changes to the form, you need to add a
> $form->process() before returning from the action subroutine.
>
> What would be ideal - and I think has been discussed before - would be
> a FormConfig action that doesn't automatically call process() - as it
> can be an expensive and possibly destructive method to call twice.
>
> I think I was initially worried about an explosion of action names, as
>  we already have:
>     Form
>     FormConfig
>     FormMethod
>     MultiForm
>     MultiFormConfig
>     MultiFormMethod
>
> Adding non-processing actions would immediately double that number.
>
>  Maybe something like
>     FormConfig('process=0')
>     FormConfig('config-file', 'process=0')
>  would be better than adding new action names.
>
> It might get hairy handling all possibilities though, as the
> attributes don't really support multiple arguments, so we'd have to
>  parse the strings ourselves.
> fex, with the above example we'd actually get something like:
>     $VAR1 = "config-file\', \'process=0"
>
>  Carl
>
>  _______________________________________________
>  HTML-FormFu mailing list
>  [email protected: HTML-F...@lists.rawmode.org]
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>



--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/

_______________________________________________
HTML-FormFu mailing list
[email protected: HTML-F...@lists.rawmode.org]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
3) Вячеслав Тихановский Carl Franks(fireartist@gmail.com)@Tue, Mar 25, 2008 at 01:45:06PM +0000: But why Text field changes...
| +1 vote (Anchor)
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Carl Franks([email protected: firea...@gmail.com])@Tue, Mar 25, 2008 at 01:45:06PM +0000:
> On 25/03/2008, vti <viacheslav.t@gmail.com> wrote:
> >
> > I created sample Cat app and behaves the same as my app. Sorry for the name, but
> >  it is what I fill now :)
>
> ah, the problem is that you're setting the default() after the
> FormConfig action calls $form->process.
>
> If you make any changes to the form, you need to add a
> $form->process() before returning from the action subroutine.
>
> What would be ideal - and I think has been discussed before - would be
> a FormConfig action that doesn't automatically call process() - as it
> can be an expensive and possibly destructive method to call twice.
>
> I think I was initially worried about an explosion of action names, as
> we already have:
>     Form
>     FormConfig
>     FormMethod
>     MultiForm
>     MultiFormConfig
>     MultiFormMethod
>
> Adding non-processing actions would immediately double that number.
>
> Maybe something like
>     FormConfig('process=0')
>     FormConfig('config-file', 'process=0')
> would be better than adding new action names.
>
> It might get hairy handling all possibilities though, as the
> attributes don't really support multiple arguments, so we'd have to
> parse the strings ourselves.
> fex, with the above example we'd actually get something like:
>     $VAR1 = "config-file\', \'process=0"
>
> Carl

But why Text field changes and Date does not? Almost in every controller I do
have FormConfig attr on a sub method and inside I do
$form->model('DBIC')->default_values( $dbic_object ) and it seems like
working... If I correctly understood you - this shouldn't work either..

Appreciate your time and help. Thanks a lot.

--
vti -- Viacheslav Tikhanovskii

_______________________________________________
HTML-FormFu mailing list
[email protected: HTML-F...@lists.rawmode.org]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
4) Вячеслав Тихановский vti(viacheslav.t@gmail.com)@Tue, Mar 25, 2008 at 05:14:50PM +0200: Meanwhile I removed FormConfig...
| +1 vote (Anchor)
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
vti([email protected: viaches...@gmail.com])@Tue, Mar 25, 2008 at 05:14:50PM +0200:
> Carl Franks([email protected: firea...@gmail.com])@Tue, Mar 25, 2008 at 01:45:06PM +0000:
> > On 25/03/2008, vti <viacheslav.t@gmail.com> wrote:
> > >
> > > I created sample Cat app and behaves the same as my app. Sorry for the name, but
> > >  it is what I fill now :)
> >
> > ah, the problem is that you're setting the default() after the
> > FormConfig action calls $form->process.
> >
> > If you make any changes to the form, you need to add a
> > $form->process() before returning from the action subroutine.
> >
> > What would be ideal - and I think has been discussed before - would be
> > a FormConfig action that doesn't automatically call process() - as it
> > can be an expensive and possibly destructive method to call twice.
> >
> > I think I was initially worried about an explosion of action names, as
> > we already have:
> >     Form
> >     FormConfig
> >     FormMethod
> >     MultiForm
> >     MultiFormConfig
> >     MultiFormMethod
> >
> > Adding non-processing actions would immediately double that number.
> >
> > Maybe something like
> >     FormConfig('process=0')
> >     FormConfig('config-file', 'process=0')
> > would be better than adding new action names.
> >
> > It might get hairy handling all possibilities though, as the
> > attributes don't really support multiple arguments, so we'd have to
> > parse the strings ourselves.
> > fex, with the above example we'd actually get something like:
> >     $VAR1 = "config-file\', \'process=0"
> >
> > Carl
>  
> But why Text field changes and Date does not? Almost in every controller I do
> have FormConfig attr on a sub method and inside I do
> $form->model('DBIC')->default_values( $dbic_object ) and it seems like
> working... If I correctly understood you - this shouldn't work either..
>
> Appreciate your time and help. Thanks a lot.

Meanwhile I removed FormConfig and cut some code from that module and everything
works like you wrote. Sorry for my confusion :(

Thanks a lot!

--
vti -- Viacheslav Tikhanovskii

_______________________________________________
HTML-FormFu mailing list
[email protected: HTML-F...@lists.rawmode.org]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
5) Вячеслав Тихановский Zbigniew Lukasiak(zzbbyy@gmail.com)@Tue, Mar 25, 2008 at 02:55:12PM +0100: Maybe it is ok just not...
| +1 vote (Anchor)
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Zbigniew Lukasiak([email protected: z...@gmail.com])@Tue, Mar 25, 2008 at 02:55:12PM +0100:
> I know this will sound extreme, but frankly, I would just entirely
> scratch the whole Catalyst::Controller::HTML::FormFu and leave it only
> as a POD describing the available integration possibilities. There is
> rather not much of code there and with so many options it is spread
> very thin.
>
> And additionally multiple inheritance causes no end of problems - so
> it is advisable to avoid forcing users to 'use base' to use your
> library.
>
> Cheers,
> Zbigniew
>
> On Tue, Mar 25, 2008 at 2:45 PM, Carl Franks <fireartist@gmail.com> wrote:
> > On 25/03/2008, vti <viacheslav.t@gmail.com> wrote:
> >  >
> > > I created sample Cat app and behaves the same as my app. Sorry for the name, but
> >  >  it is what I fill now :)
> >
> > ah, the problem is that you're setting the default() after the
> >  FormConfig action calls $form->process.
> >
> > If you make any changes to the form, you need to add a
> > $form->process() before returning from the action subroutine.
> >
> > What would be ideal - and I think has been discussed before - would be
> > a FormConfig action that doesn't automatically call process() - as it
> > can be an expensive and possibly destructive method to call twice.
> >
> > I think I was initially worried about an explosion of action names, as
> >  we already have:
> >     Form
> >     FormConfig
> >     FormMethod
> >     MultiForm
> >     MultiFormConfig
> >     MultiFormMethod
> >
> > Adding non-processing actions would immediately double that number.
> >
> >  Maybe something like
> >     FormConfig('process=0')
> >     FormConfig('config-file', 'process=0')
> > would be better than adding new action names.
> >
> > It might get hairy handling all possibilities though, as the
> > attributes don't really support multiple arguments, so we'd have to
> >  parse the strings ourselves.
> > fex, with the above example we'd actually get something like:
> >     $VAR1 = "config-file\', \'process=0"
> >
> >  Carl

Maybe it is ok just not to call ->process inside of FormConfig and not bother
about flags and stuff? It's up to the user when it is time to build the form
and FormConfig just creates config :-)

--
vti -- Viacheslav Tikhanovskii

_______________________________________________
HTML-FormFu mailing list
[email protected: HTML-F...@lists.rawmode.org]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
6) Byron Young If you look at the HTML::FormFu::Element::Date code, you can see that Date = only parses the...
| +1 vote (Anchor)
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
> -----Original Message-----
> From: vti [email protected: viaches...@gmail.com]
> Sent: Tuesday, March 25, 2008 8:15 AM
> To: [email protected: html-f...@lists.rawmode.org]
> Subject: Re: [html-formfu] non-processing actions, WAS: Date
> element stopped working
>
> Carl Franks([email protected: firea...@gmail.com])@Tue, Mar 25, 2008 at 01:45:06PM
> +0000:
> > On 25/03/2008, vti <viacheslav.t@gmail.com> wrote:
> > >
> > > I created sample Cat app and behaves the same as my app. Sorry
> for the name, but
> > >  it is what I fill now :)
> >
> > ah, the problem is that you're setting the default() after the
> > FormConfig action calls $form->process.
> >
> > If you make any changes to the form, you need to add a
> > $form->process() before returning from the action subroutine.
> >
> > What would be ideal - and I think has been discussed before -
> would be
> > a FormConfig action that doesn't automatically call process() -
> as it
> > can be an expensive and possibly destructive method to call
> twice.
> >
> > I think I was initially worried about an explosion of action
> names, as
> > we already have:
> >     Form
> >     FormConfig
> >     FormMethod
> >     MultiForm
> >     MultiFormConfig
> >     MultiFormMethod
> >
> > Adding non-processing actions would immediately double that
> number.
> >
> > Maybe something like
> >     FormConfig('process=3D0')
> >     FormConfig('config-file', 'process=3D0')
> > would be better than adding new action names.
> >
> > It might get hairy handling all possibilities though, as the
> > attributes don't really support multiple arguments, so we'd have
> to
> > parse the strings ourselves.
> > fex, with the above example we'd actually get something like:
> >     $VAR1 =3D "config-file\', \'process=3D0"
> >
> > Carl
>
> But why Text field changes and Date does not? Almost in every
> controller I do
> have FormConfig attr on a sub method and inside I do
> $form->model('DBIC')->default_values( $dbic_object ) and it seems
> like
> working... If I correctly understood you - this shouldn't work
> either..
>
> Appreciate your time and help. Thanks a lot.
>
> --
> vti -- Viacheslav Tikhanovskii
>

If you look at the HTML::FormFu::Element::Date code, you can see that Date =
only parses the 'default' attribute in _date_defaults(), which is called in=
_add_elements(), which is called in -- you guessed it -- process().

Regards,
Byron

_______________________________________________
HTML-FormFu mailing list
[email protected: HTML-F...@lists.rawmode.org]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
spacer
View TopicPrint | Flat  Thread  Threaded
Home > Groups > HTML::FormFu > [html-formfu] non-processing actions, WAS: Date element stopped working (6 posts)