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

Mario Minati mario.minati at googlemail.com
Sat Oct 20 20:45:45 GMT 2007


On Saturday 20 October 2007 01:12:09 Jonas Alves wrote:
> 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 = HTML::FormFu->new;
> >     $form->element({ type => 'Date', name => 'date' });
> >
> >     $form->process({
> >         'date.day ' => 1,
> >         'date.month' => 10,
> >         'date.year' => 2007,
> >     });
> >
> >     print Dumper( $form->params );
> >
> > I get the following output:
> >
> >     $VAR1 = {
> >               ' date.day' => 1,
> >               'date.month' => 10,
> >               'date.year' => '2007',
> >               'date' => '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 => '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.

Sorry for being quite about nested params the last couple weeks. I was in the 
process of rolling out a first release of my App in our company and that 
needed all my time.

The nested param stuff will extend formfu to define for e. g. a fieldset a 
param 'nested'. That means all elements of that fieldset can be addressed as 
nested_param_value.element_name or in []-style, which will be configurable.

As these changes go quite deep into formfu I rather thing the way implementing 
it twice or triple. Carl and I started on that some weeks ago and stopped 
here: 
http://lists.scsys.co.uk/pipermail/html-formfu/2007-September/000486.html

So it's my turn for now. But I won't get on it before the 29th.

Greets,
Mario



More information about the HTML-FormFu mailing list