[html-formfu] HTML::FormFu::Model::DBIC and Many-to-many

Carl Franks fireartist at gmail.com
Tue Feb 3 19:34:26 GMT 2009


2009/2/3 Nigel Metheringham <nigel.metheringham at dev.intechnology.co.uk>:
> I'm really not getting how the many-to-many support works in this, so could
> someone mock me up an example.

There are test files for many-to-many in:
t/default_values/
t/update/
t/options_from_model/

> to select the capabilities that superhero has, so I would like the form to
> have something like a list of all the defined capabilities ('Fly', Leap
> Buildings in a single bound', 'X-ray vision', 'Fire' etc) with a checkbox
> for each - ie has/has-not.

Check the many_to_many_select* test files.
You'd need to use an element for which multi_value() is true, e.g.
Select or Checkboxgroup

> Also, if I then decided to rate each capability for each superhero, so
> Batman could leap very small buildings (so power of 2), whereas Superman
> could leap tall buildings (power 100), how could I produce a form with both
> has/has-not checkbox and a power rating?

I don't think it's currently possible in a single step, to both select
which one's to relate, and edit them.
It's either a multi-value element to select them, or a Repeatable
block to edit the already related rows.

Carl



More information about the HTML-FormFu mailing list