On 22/02/2008, Zbigniew Lukasiak <[EMAIL PROTECTED]> wrote: > On Thu, Feb 21, 2008 at 11:54 PM, Steve Caldwell > > <[EMAIL PROTECTED]> wrote: > > > I'm building a form that has a Select element that I'm mapping to a > > non-column accessor on my DBIC object, as described in "non-column > > accessors" in the HTML::FormFu::Model::DBIC POD, like this: > > > > --- > > action: /foo > > elements: > > - type: Select > > name: bar > > label: Your Bar > > db: > > accessor: bar > > options: > > - [ 01, January ] > > - [ 02, February ] > > > > When I then try and populate it from my DBIC object: > > > > $form->defaults_from_model( $myobj ); > > > > HTML::FormFu::Model::DBIC::options_from_model gets called (thanks to > > line 44 in HTML::FormFu::Element::_Group), which then overwrites the > > options I've set from my select list with a bunch of stuff from the > > database. This is obviously not what I want here. > > > Just for clarification in that 44 line in > HTML::FormFu::Element::_Group you are in post_process - and > post_process is called after processing the form not in the > options_from_model call. > > Can anyone confirm that?
Yes, options_from_model() should only be getting called during $form->process() not during defaults_from_model() Carl _______________________________________________ HTML-FormFu mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
