[html-formfu] Repeatable and many_to_many relationship - Not able to update table

Jorge Augusto Senger jasenger at gmail.com
Mon Oct 26 16:58:19 GMT 2009


Hi folks,

I need some help regarding repeatable elements and a many_to_many relationship.
My data scenario is the following:

[ table users ] [ table users_roles ] [ table roles ]
There's a relationship users_roles in my Schema:
__PACKAGE__->many_to_many(roles => 'users_roles', 'role');

I have two forms to populate those tables.
The first one works perfectly. I've basicaly a select field where my
users can choose the roles for a particular user:

          - type: Select
            name: roles
            label: 'Roles'
            model_config:
              resultset: 'Roles'
              id_column: role_id
              label_column: role_description
            attributes:
              size: 5
              multiple: 1
              title: 'Roles'

On a second form I've a repeatable element where my users can fill
some considerations about the roles previously selected:

            - type: Repeatable
              nested_name: roles
              counter_name: roles_count
              elements:

                - type: Hidden
                  name: user_id

                - type: Hidden
                  name: roles_count
                  default: 1

                - type: Hidden
                  name: role_id
                  default: 1

                - type: Text
                  name: role_text
                  label: 'Considerations regarding the role'
                  attributes:
                    title: 'Considerations regarding the role'
                    size: 25

This form renders fine, I got one text field called
"roles_#.role_text" for each role that was previously selected.
However, I'm not able to update my table with the contents of the
field role_text.
I got no errors or warnings, It simply don't update my table.

I didn't find an explanation about this behavior on the docs, so I
hope you guys can help me. I hope I made myself clear about the issue.

Thanks a lot in advance,

Jorge Augusto Senger
jasenger (at) gmail.com

use Perl;



More information about the HTML-FormFu mailing list