On 15/12/2007, Jonas Alves <[EMAIL PROTECTED]> wrote: > Hi Guys, > I have a form with an element like this: > > - type: Block > tag: ~ > nested_name: area_rel > elements: > - type: Checkboxgroup > name: area_id > options: [ ... ] > constraints: [ AutoSet ] > > area_rel is a many_to_many relationship defined in my model. > > > And defaults_from_model fails to fill it. Am I doing something wrong, or > this is not supported yet?
Hi Jonas, http://search.cpan.org/~cfranks/HTML-FormFu-0.02002/lib/HTML/FormFu/Model/DBIC.pm#many_to_many_selection You don't need the Block for that: type: Checkboxgroup name: area_rel If area_id is the PK, it'll pick that up automatically, otherwise you can be explicit: db: { default_column: area_id } And this isn't documented yet because it may change, but with the catalyst controller you can populate the Checkboxgroup from the db like so: type: Checkboxgroup name: area_rel db: model: MyModel label_col: area See the source of Element/_Group::process() for more details. Cheers, Carl _______________________________________________ HTML-FormFu mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
