[html-formfu] Add more than one item (repeatable DBIC)

Moritz Onken onken at houseofdesign.de
Wed Apr 30 16:14:07 BST 2008


Am 30.04.2008 um 16:54 schrieb Carl Franks:

> 2008/4/23 Moritz Onken <onken at houseofdesign.de>:
>> Hi,
>> attached is a test which fails if you add more than one item to a  
>> has-many
>> relationship:
>>
>> I hope I didn't miss a config switch?!
>
> At the moment, the 'new_empty_row' option only allows you to add 1  
> new row.
> Yes, supporting more than 1 row would be good.
> First off, you could test whether it works by deleting line 383 from
> lib/HTML/FormFu/Model/DBIC.pm
> - it's the line that reads "&& $i == $max"
>
> I think though, that this new behaviour should be off by default, with
> a new option to switch it on.
> I wondering whether this option's value should be a number, that can
> control the maximum allowed number of new rows?
>
> Carl

In my case I allow the user to add as many empty fields as they wish  
which is done via some DOM cloning. The number of new elements are not  
known until the user submits. I thought the max number of inserts  
could be limited by a constraint attached to the count field. This  
would be straight forward.

I'll test what you suggested.

thanks



More information about the HTML-FormFu mailing list