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.

Anyone else come across this problem?  The work-around isn't that much
work (manually populate from and save to my object instead of using
defaults_from_model() and save_to_model()), but it would be cooler if it
all worked correctly.

-Steve


_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to