[html-formfu] Fwd: Model::DBIC: creating many new rows

Carl Franks fireartist at gmail.com
Fri Aug 1 12:29:35 BST 2008


2008/8/1 Moritz Onken <onken at houseofdesign.de>:
>>>
>>
>> Hmm, not sure if you tried running the test ;) the tests failed, the
>> count was out - and I don't think the .pm patch does what it should.
>> But anyway, moving on...
>>
>> The only thing I'm not keen on is the similarity between the method
>> names 'new_empty_row' and 'new_empty_rows'.
>> Too confusing.
>>
>> Currently, 'new_empty_row' must be set to a column-name or array-ref of
>> names.
>> Instead of 'new_empty_rows', how about adding a 'new_empty_row_max'
>> (or something similar) which defaults to 1, but can be set to any
>> number, and -1 means 'no limit'?
>
> Yes I thought about that name problem too. I think new_empty_row_max is
> fine.
> I just thought that putting a constraint on the count field is more straight
> forward and makes it easier to get the error message if there are more rows
> than the maximum allowed.

Ah, yes - it's limited by the number of Rep blocks, which is set by the count.
So yes, you can add a hidden field for the counter_name(), and have a
constraint on it.

Okay, stick with the way you coded it, but maybe just rename
'new_empty_rows' to 'new_empty_row_multi' to indicate more than 1 row
is allowed.
And don't say I flip-flop ;)

Feel free to commit!

Carl



More information about the HTML-FormFu mailing list