/** * @param Nette\Application\UI\Form $form */ public function taskFormSubmitted(Form $form) { $this->tasks->createTask($this->list->id, $form->values->text, $form->values->userId); $this->flashMessage('Úkol přidán.', 'success'); if (!$this->isAjax()) { $this->redirect('this'); } $form->setValues(array('userId' => $form->values->userId), TRUE); $this->invalidateControl('form'); $this['taskList']->invalidateControl(); }