[html-formfu] Delete option in repeatable block does not work

Carl Franks fireartist at gmail.com
Thu Jan 22 08:09:45 GMT 2009


2009/1/21 Ascii King <tech at swattermatter.com>:
> I can't get the delete checkbox to function in my has_many repeatable block.
> It has never worked in any of the test websites I have created. Here is the
> code I use, though I have removed the extraneous bits.
>
> # ** REPEAT APPOINTMENTS --
>   - type: Repeatable
>     nested_name: appointments
>     counter_name: thecount
>     model_config:
>       new_empty_row_multi: appointment_date
>       delete_if_true: goAway
>     elements:
>
>       - type: Hidden
>         name: appointment_id
>
> # APPOINTMENT DATE --
>       - type: Text
>         name: appointment_date
>         label: Appointment Date
>         model_config:
>           delete_if_empty: 1
>
> # DELETE APPOINTMENT --
>       - type: Checkbox
>         name: goAway
>         label: Delete
>
>
> # THECOUNT --
>  - type: Hidden
>   name: thecount
>
> My has_many works properly except for this one thing. The "delete_if_empty:
> 1" works as it is supposed to.

Looks like the docs need fixed.
According to the test suite, "delete_if_true: 1" should be attached to
the Checkbox's model_config, not the Repeatables.

I really recommend checking the test suite if something's not working
- as it's a lot more thorough than the docs.

Carl



More information about the HTML-FormFu mailing list