Hi,

referring to this post:

http://lists.scsys.co.uk/pipermail/html-formfu/2008-April/001158.html

I created the following patch which allows the user to specify a new_empty_rows config option. This allows the user to add as many new rows as he wishes. He can still restrict it by putting
a constraint on the count field.

Test attached.

Attachment: has_many_repeatable_many_new.yml
Description: Binary data

Attachment: has_many_repeatable_many_new.t
Description: Binary data




What do you think?

cheers,

moritz

Index: lib/HTML/FormFu/Model/DBIC.pm
===================================================================
--- lib/HTML/FormFu/Model/DBIC.pm       (revision 1086)
+++ lib/HTML/FormFu/Model/DBIC.pm       (working copy)
@@ -37,7 +37,7 @@

        return _merge_hashes( $config, $dbic );
    }
-
+    #$config->{new_empty_row} ||= $config->{new_empty_rows};
    return $config;
}

@@ -474,7 +474,7 @@
        my $row;

        if (   ( !defined $value || $value eq '' )
-            && $i == $max
+            && ($i == $max || $config->{new_empty_rows})
            && $config->{new_empty_row} )
        {

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to