[Html-widget] formfu - What's the best way to add dynamic defaults?

Carl Franks fireartist at gmail.com
Thu Mar 29 12:14:18 GMT 2007


On 29/03/07, Daisuke Maki <daisuke at endeworks.jp> wrote:
> It would be B)

Okay, I've had to add a new method to fields:
render_processed_value(1) which overrides the default behaviour of
displaying the un-filtered user input.

Save the attached files in the root of /trunk/HTML-FormFu/ and run
`perl test.pl`.
You can change $form->process() to pass either a valid or invalid
date, and you'll see in the output that both $form->params and "$form"
behave correctly.

I'm still going to think of a better way to handle this kind of thing thoug=
h.
It's also possible that the render_processed_value() method might get
replaced by something more flexible, to allow you to choose to display
the input after filters or transformations, as it's a bit of a blunt
instrument at the moment.

Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.yml
Type: application/octet-stream
Size: 262 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-widget/attachments/20070329/f=
53aa6c7/test-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyDeflator.pm
Type: application/x-perl
Size: 598 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-widget/attachments/20070329/f=
53aa6c7/MyDeflator-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyFilter.pm
Type: application/x-perl
Size: 539 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-widget/attachments/20070329/f=
53aa6c7/MyFilter-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pl
Type: application/x-perl
Size: 276 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-widget/attachments/20070329/f=
53aa6c7/test-0001.bin


More information about the Html-widget mailing list