From 1db4745bece65f0ebd14146e725a8f8b0c877dce Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 26 Oct 2014 20:25:05 +0100 Subject: [PATCH] Form: calling setAction() bypasses creation of 'do' element [Closes #33] --- src/Application/UI/Form.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Application/UI/Form.php b/src/Application/UI/Form.php index a8bcb284f..f0980dcb8 100644 --- a/src/Application/UI/Form.php +++ b/src/Application/UI/Form.php @@ -70,6 +70,9 @@ protected function attached($presenter) if (!$this->getAction()) { $this->setAction(new Link($presenter, 'this', array())); + $signal = new Nette\Forms\Controls\HiddenField($name . self::NAME_SEPARATOR . 'submit'); + $signal->setOmitted()->setHtmlId(FALSE); + $this[Presenter::SIGNAL_KEY] = $signal; } if (iterator_count($this->getControls()) && $this->isSubmitted()) { @@ -79,10 +82,6 @@ protected function attached($presenter) } } } - - $signal = new Nette\Forms\Controls\HiddenField($name . self::NAME_SEPARATOR . 'submit'); - $signal->setOmitted()->setHtmlId(FALSE); - $this[Presenter::SIGNAL_KEY] = $signal; } parent::attached($presenter); }