public function processForm(UI\Form $form)
{
$allowRedirect = true;
if (isset($form['edit'])) {
if ($form['edit']['save']->isSubmittedBy()) {
if ($form['edit']->isValid()) {
call_user_func($this->editFormCallback, $form['edit']);
} else {
$this->editRowKey = $form['edit'][$this->rowPrimaryKey]->getValue();
$allowRedirect = false;
}
}
if ($form['edit']['cancel']->isSubmittedBy() || $form['edit']['save']->isSubmittedBy() && $form['edit']->isValid()) {
$editRowKey = $form['edit'][$this->rowPrimaryKey]->getValue();
$this->redrawRow($editRowKey);
$this->getData($editRowKey);
}
if ($this->editRowKey !== null) {
$this->redrawRow($this->editRowKey);
}
}
if (isset($form['filter'])) {
if ($form['filter']['filter']->isSubmittedBy()) {
$values = $form['filter']->getValues(true);
unset($values['filter']);
$values = $this->filterFormFilter($values);
if ($this->paginator) {
$this->page = $this->paginator->page = 1;
}
$this->filter = $this->filterDataSource = $values;
$this->redrawControl('rows');
} elseif ($form['filter']['cancel']->isSubmittedBy()) {
if ($this->paginator) {
$this->page = $this->paginator->page = 1;
}
$this->filter = $this->filterDataSource = $this->filterDefaults;
$form['filter']->setValues($this->filter, true);
$this->redrawControl('rows');
}
}
if (!$this->presenter->isAjax() && $allowRedirect) {
$this->redirect('this');
}
}