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