[dave.riverside@gmail.com - Fri Sep 30 19:49:37 2005]:
Show quoted text> On 9/30/05, Guest via RT <bug-Maypole-FormBuilder@rt.cpan.org> wrote:
> >
> > Sometimes all the trickery used by process_fields,
> form_builder_defaults, etc.. gets in the way. All I want to do is
> tweak some values for the form right before rendering.
> >
> > How about a hook that you would override in your model classes like
> so:
> >
> > sub form_post_process {
> > my($self, $form) = @_;
> > }
> >
> > where $form is the CGI::FormBuilder object. Maybe you'd want to
> pass in the CDBI::FB instance too, but not sure why you'd need it
> offhand.
> >
>
> Why can't you post-process the form after you get it back from
> CDBI::FB?
>
> d.
You mean in the template? I could, but don't like it. There are
certain things that just shouldn't be modified in the template. Plus,
in TT, you'd have to use ugly [% PERL %] blocks to modify it, because
far as I know, CGI::FB doesn't use TT calling conventions. Finally,
this wouldn't work for what I want to do. Many, but not all of my
tables have a series of standard columns (created_by, created_ts,
updated_by, updated_ts) with obvious meanings. These should not be in
the form. I don't always remember to make the adjustments to my model
classes (overriding edit_columns and addnew_columns). I'd like to just
have a method in my base class that gets rid of these
fielrelated_class_and_rel_typeds if they are there. I've also run into
a few instances where the field processors act strangely (to me anyway..
i've mentioned a couple of these in other threads), and I'd just like
to be able to manually tweak the form.
I could do it in the template, but it'd be ugly, and it forces the
template writer (in this case me, but you know..) to be aware of stuff
that is purely on the backend.