Skip Menu |

This queue is for tickets about the HTML-FormFu CPAN distribution.

Report information
The Basics
Id: 42085
Status: resolved
Priority: 0/
Queue: HTML-FormFu

People
Owner: Nobody in particular
Requestors: mjh [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.03007
Fixed in: (no value)



Subject: Repeatable doesn't work with ComboBox
If only one element exists, everything works. If repeatable is called with more than one, it doesn't not work. Without increment_field_names set, no entries are return to param_array(). With increment_field_names, only the first entry ends up in $form->params, but no results are returned for $form->param_entry(fieldname). Attached is yml and a simple test case.
Subject: combobox_repeatable.t
use strict; use warnings; use Test::More tests => 6; use HTML::FormFu; my $form = HTML::FormFu->new({ tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } }); $form->load_config_file('t-aggregated/elements/combobox_repeatable.yml'); # repeatable { my $container = $form->get_all_element('container'); $container->repeat( 5 ); $form->process({ combo_select_1 => 'one', combo_select_2 => 'two', combo_select_3 => 'three', }); ok( $form->submitted_and_valid ); is( $form->param_value('combo_1'), 'one' ); is( $form->param_value('combo_2'), 'two' ); is( $form->param_value('combo_3'), 'three' ); is( $form->param_value('combo_select_3'), 'three' ); is( $form->param_value('combo_select'), 'three' ); is( $form->param_value('combo'), 'three' ); }
Subject: combobox_repeatable.yml
--- elements: - type: Repeatable name: container increment_field_names: 1 elements: - type: ComboBox name: combo values: - one - two - three constraints: - Required - type: Submit name: submit
If you change the names passed to $form->process() from e.g. "combo_select_1" to "combo_1_select" - to match the names in the rendered form - the tests pass ok. Though, I've removed the 2 tests for $form->param_value('combo_select') $form->param_value('combo' as I don't think they should pass - they don't match any fields in the form. I've added your (modified) test files to svn. If you're still having issues, please do send more test files describing the problem. Thanks - Carl