On Dec 16, 2007 6:18 PM, Carl Franks <[EMAIL PROTECTED]> wrote: > On 16/12/2007, Jonas Alves <[EMAIL PROTECTED]> wrote: > > I can't make it work. The Checkboxgroup is not being populated. > > Element/_Group::process is not being called at all. > > Checkboxgroup doesn't override process(), so if _Group::process() > isn't being called, it's likely you're not calling $form->process() > Are you using Catalyst-Controller-HTML-FormFu ? > > > This is what I have in the config file: > > > > - type: Checkboxgroup > > name: area_rel > > db: > > model: DBIC::Area > > label_col: name > > constraints: [ AutoSet ] > > > > The rels in DBIC::Campanha model: > > > > __PACKAGE__->has_many( > > area_rel => 'SMS::Schema::Result::AreaCampanha', > > 'campanha_id', > > ); > > __PACKAGE__->many_to_many(areas => 'area_rel', 'area_id',); > > > > # in my app: > > > > $form->defaults_from_model( $campanha_row ); > > > > If I change the rel in the config to "name: areas" instead of "name: > > area_rel" I got this error: > > It should be "name: areas", to match the name of the many_to_many > relationship > > > [error] DBIx::Class::Relationship::ManyToMany::__ANON__(): > > search_related: result source 'AreaCampanha' has no such relationship > > area_id at /Library/Perl/5.8.6/HTML/FormFu/Model/DBIC.pm > > line 186 > > __PACKAGE__->many_to_many(areas => 'area_rel', 'area_id',); > is wrong, the 3rd argument 'area_id' should be the name of the > relationship in the link table that points to the area table. > See > http://search.cpan.org/~ash/DBIx-Class-0.08008/lib/DBIx/Class/Relationship.pm#many_to_many<http://search.cpan.org/%7Eash/DBIx-Class-0.08008/lib/DBIx/Class/Relationship.pm#many_to_many> > > Carl >
Yep, It was exactly that. I feel really embarrassed. Thanks. :) -- Jonas
_______________________________________________ HTML-FormFu mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
