WebChemistry\Forms\Controls\Multiplier : Component ‚value‘ is not attached to ‚Nette\Forms\Form‘
- duskohu
- Člen | 778
Ahojte pouzivam WebChemistry Multiplier a ked dam pridat item, tak sa mi
stane to ze mi vypise:
Component 'value' is not attached to 'Nette\Forms\Form'
, snazim sa
zistit getHtmlName()
elementu v replikatore. Neviete mi poradit
ako to riesit?
/** @var \WebChemistry\Forms\Controls\Multiplier $multiplier */
$multiplier = $form->addMultiplier('params',
function (\Nette\Forms\Container $container, \Nette\Forms\Form $form) use ($paramsList) {
$container->addText('value', 'Hodnota')
->setAttribute('placeholder', 'Hodnota');
bdump($container['value']->getHtmlName());// toto sposobuje error
}, 0);
$multiplier->addCreateButton('Pridať', 1)
->setNoValidate()
->onCreate[] = function (SubmitButton $button) {
if ($this->presenter->isAjax()) {
$this->redrawControl();
}
};
$multiplier->addRemoveButton('Odstrániť')
->onCreate[] = function (SubmitButton $button) {
if ($this->presenter->isAjax()) {
$this->redrawControl();
}
};
Editoval duskohu (23. 7. 2019 15:05)