Hi Filip,
here's a pseudo code that demonstrates the issue:
$form = new NAppForm($parent, $name);
$form->addDynamic('players', function (NFormContainer $container) {
$container->addText('rank');
});
$form->addHidden('tournament_id');
When defined like this, I can set default values, render the form manually with {input players-$playerId-rank} however, it won't load submitted values into players upon submit because $this->getComponents() in NFormContainer/getValues() loop returns nothing. So when I call $form->values in my processing method I get an empty iterator/array for players.
If however, I place the hidden item before the dynamic one, everything works fine:
$form = new NAppForm($parent, $name);
$form->addHidden('tournament_id');
$form->addDynamic('players', function (NFormContainer $container) {
$container->addText('rank');
});
Please let me know if you're able to replicate the issue. If not, I would send a full test app (probably next month though, I'm short of time right now).
Nette Framework 2.0.8 (revision b7f6732 released on 2013-01-01)
Hi Filip, here's a pseudo code that demonstrates the issue:
When defined like this, I can set default values, render the form manually with {input players-$playerId-rank} however, it won't load submitted values into players upon submit because $this->getComponents() in NFormContainer/getValues() loop returns nothing. So when I call $form->values in my processing method I get an empty iterator/array for players.
If however, I place the hidden item before the dynamic one, everything works fine:
Please let me know if you're able to replicate the issue. If not, I would send a full test app (probably next month though, I'm short of time right now).
Nette Framework 2.0.8 (revision b7f6732 released on 2013-01-01)