FAQ
Hello all,

I have a form with a field filled in with a timestamp (via DateTime
inflator) from a DB.
The default stringification of the DateTime object is kinda ugly
(2008-04-18T17:10:06)
so I have set up a strftime deflator for the field to format it properly.

This field is disabled therefore when the user submits the form, the
field value is not sent to the server.
After submission I re-display the form, but since the field was not sent
the field is empty.
I have set "retain_default" for the field and upon submission the field
is displayed with the proper value from the DB.

The problem is that the second time (after submission) the deflation
phase is skipped thus the ugly DateTime stringified
value is displayed. Setting "render_processed_value" has no effect
(probably because the field does not appear in the request sent to the
server).

Is there another way to accomplish displaying a formatted value fetched
from the database or am I overlooking something?

Kiki

Search Discussions

  • Carl Franks at May 7, 2008 at 3:58 pm

    2008/4/18 Kiki <kiki@bsdro.org>:
    Hello all,

    I have a form with a field filled in with a timestamp (via DateTime
    inflator) from a DB.
    The default stringification of the DateTime object is kinda ugly
    (2008-04-18T17:10:06)
    so I have set up a strftime deflator for the field to format it properly.

    This field is disabled therefore when the user submits the form, the field
    value is not sent to the server.
    After submission I re-display the form, but since the field was not sent
    the field is empty.
    I have set "retain_default" for the field and upon submission the field is
    displayed with the proper value from the DB.

    The problem is that the second time (after submission) the deflation phase
    is skipped thus the ugly DateTime stringified
    value is displayed. Setting "render_processed_value" has no effect
    (probably because the field does not appear in the request sent to the
    server).

    Is there another way to accomplish displaying a formatted value fetched
    from the database or am I overlooking something?
    Hi Kiki,

    I've fixed this now, so it should work as you expect - it's available
    in svn revision 1009, and will be included in the next cpan release.

    You can check the test files to compare the config I used:
    t/bugs/render_processed_value_retain_default.t
    t/bugs/render_processed_value_retain_default.yml

    Cheers,
    Carl

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouphtml-formfu @
categoriesperl, catalyst
postedApr 18, '08 at 4:29p
activeMay 7, '08 at 3:58p
posts2
users2
websitemetacpan.org...

People

Translate

site design / logo © 2022 Grokbase