[html-formfu] Question about grabbing info from Repeatable element
Mario Minati
mario.minati at googlemail.com
Tue Jul 28 11:33:27 GMT 2009
Shawn Moughtin schrieb:
> Mario Minati wrote:
>
>> Hi Shawn,
>>
>> sorry but I don't understand yet where your problem lifes. On the
>> javscript side or on the perl side. Usually formfu will do all the
>> backend processing for you and you don't have to play with
>> nested_names and so on.
>> You can add more fields with javascript and just adjust the count
>> field and it will work.
>> Maybe you forgot to the set new_rows_max modelconfig value of the
>> repeatable block to an appropriate value, otherwise the DBIC model
>> will not add the new rows.
>>
>> Greets,
>>
>> Mario
>>
> That is working for me. The problem I am having is that I am using
> someone else's javascript code that provides additional functionality
> if I give the <div> tag surrounding the repeatable element a
> sequential ID. Since the auto_id doesn't affect the div tag, I need to
> grab the ID from an element and build a sequential ID from it.
>
> My blockage is that nested_name only contains information if the
> repeatable is only one level deep.
> For example:
>
> type: Repeatable
> nested_name: outer
> elements:
> type: Repeatable
> nested_name: inner
> elements:
>
> If I grab the nested_name from the outer repeatable, I would get
> nested_name == outer_1
> If I grab the inner nested_name, I would hope to get nested_name ==
> outer_1.inner_1, but instead I get a NULL
>
Maybe the HTML::FormFu test in t/nested/elements/repeatable_repeatable.t
helps you understanding.
If you call nested_name on the field, than you should no get NULL.
Greets,
Mario Minati
More information about the HTML-FormFu
mailing list