[html-formfu] Re: DBIC::Validation::FormFu RFC & Element::Date patch

Jonas Alves jonas.alves at gmail.com
Sat Oct 20 00:12:09 GMT 2007


On 19/10/2007, Carl Franks <fireartist at gmail.com> wrote:
>
>
> Hi Jonas,
>
> At first I had been holding off, in case we heard anything from mario
> about his work on nested-params, as it would be preferable to solve
> this throughout the form, rather than just a single element.
> Regardless, I've just had a look at the patch, and I'm wondering if
> you overlooked something, as it doesn't seem to be necessary.
> For an example, if I run the following:
>
>     $form =3D HTML::FormFu->new;
>     $form->element({ type =3D> 'Date', name =3D> 'date' });
>
>     $form->process({
>         'date.day ' =3D> 1,
>         'date.month' =3D> 10,
>         'date.year' =3D> 2007,
>     });
>
>     print Dumper( $form->params );
>
> I get the following output:
>
>     $VAR1 =3D {
>               ' date.day' =3D> 1,
>               'date.month' =3D> 10,
>               'date.year' =3D> '2007',
>               'date' =3D> '01-10-2007'
>             };
>
> So even if the names with a dot in them are deleted by DBIC, you've
> still got the 'date' key.
> I'm guessing you had either set strftime or used an Inflator to get the
> output:
>     { date =3D> '2007-01-01 00:00:00' }
>
> Did you miss this, or am I not getting something?
>
> Carl
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.rawmode.org
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>

Hi Carl,
The 'date' parameter is created only if 'date.*' parameters are passed to
process. But dbic deletes them, so FormFu never gets anything about the date
field.
How is the work on nested-params going? How would it work? Some months ago I
wrote something about nested-params to the HTML::Widget list but never got a
response. See
http://lists.scsys.co.uk/pipermail/html-widget/2007-April/000602.html. Will
it work something like that?
Maybe I can help. I would like to have this in FormFu very much.

-- =

Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20071020/2b=
6f557d/attachment.htm


More information about the HTML-FormFu mailing list