-
-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Milestone
Description
- bug report? no
- feature request? yes
- version: 2.4
Description
I'm just starting to learn Nette and after looking through documentation and example code i tried to setup a very simple Form. The Form rendered fine, but the onSuccess handler was never executed and it took me a very long time to figure out the problem:
I created a Nette\Forms\Form-Object instead of the Nette\Application\UI\Form-Object that i was supposed to use.
It would be great if there would be an Exception if one tries to use the Nette\Forms\Form like a Nette\Application\UI\Form. Or at least mention this pitfall in the documentation somewhere.
Thanks.
Steps To Reproduce
- Be very inexperienced with the Nette Framework
- Write code like this in your Presenter:
public function createComponentMyForm() {
$form = new Nette\Forms\Form;//<- This is the Problem.
$form->addSubmit('submit_it', "Submit!");
$form->onSuccess[] = [$this, 'formSucceeded'];
return $form;
}
public function formSucceeded($form, $values) {
//This will never be called
}- Get frustated
dg, misaon, Ciki and eydun
Metadata
Metadata
Assignees
Labels
No labels