contributte / forms-multiplier

:repeat: Form multiplier & replicator for Nette Framework

Home Page:https://contributte.org/packages/contributte/forms-multiplier.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Component 'multiplier_remover' is not attached to 'Nette\Forms\Form'

janholas opened this issue · comments

When using manual rendering of forms with groups and iterating over groups, I am getting InvalidStateException: Component 'multiplier_remover' is not attached to 'Nette\Forms\Form'

...
$form->addGroup("TEST");
$multi = $form->addMultiplier("multi", function(\Nette\Forms\Container $container, \Nette\Application\UI\Form $form) {
            $container->addText("a", "A");
        }, 1);

$multi->addCreateButton("Add");
$multi->addRemoveButton("Remove");
....

Latte:

{form testForm}
    {foreach $form->getGroups() as $groupName => $group}
        {foreach $group->getControls() as $name => $input}
             {input $input}
        {/foreach}
    {/foreach}
{/form}

This error doesn't happen when the form is rendered automatically or you itarate right over $form->getControls()

Sorry for late response. Thank you for issue