[html-formfu] defaults_from_model doesn't call deflators
Carl Franks
fireartist at gmail.com
Tue Feb 5 10:32:45 GMT 2008
On 05/02/2008, Moritz Onken <onken at houseofdesign.de> wrote:
> it's HTML::FormFu::Deflator::Strftime not
> HTML::FormFu::Deflator::DateTime which allows me to stringify the
> DateTime object to a string which fits to the locale of the user.
Yes, I got the name wrong.
> I do not call $form->render because I use FormFu to create a JSON file
> to load a form using ExtJS. FormFu does all the validation etc. but
> doesn't render the form itself.
How are you creating the JSON?
You should really be using $form->render_data() to get the form data
for any kind of output, rather than just inspecting $form - otherwise
you must be duplicating a lot of the logic inside FormFu.
... Has the form already been submitted? Do we use the default value,
or the submitted value.
... Is render_processed_value() set?
... Creating element IDs from auto_id()
... Date and SimpleTable elements won't work properly if render_data()
isn't called.
I'm sure there must be other issues I can't think of, off hand ;)
If you don't want to switch yet from just using $form, you could
probably get away with just doing:
$field->render_data->{value};
Carl
More information about the HTML-FormFu
mailing list