diff --git a/src/MvcCore/Ext/Form/Dispatching.php b/src/MvcCore/Ext/Form/Dispatching.php index 0a854a3..3fd3a21 100644 --- a/src/MvcCore/Ext/Form/Dispatching.php +++ b/src/MvcCore/Ext/Form/Dispatching.php @@ -83,21 +83,28 @@ public function DispatchStateCheck ($state, $submit = FALSE) { return TRUE; // here is always `$this->dispatchState < $state`: $this->dispatchStateSemaphore = TRUE; + if ($submit === NULL) { if ($this->submit === NULL) $this->submit = $this->initDetectSubmit(); $submit = $this->submit; } + if ($state > static::DISPATCH_STATE_INITIALIZED) - $this->dispatchTemplateMethod( - 'Init', static::DISPATCH_STATE_INITIALIZED, $submit + $this->dispatchMethods( + $this, 'Init', + static::DISPATCH_STATE_INITIALIZED, FALSE ); + if ($state > static::DISPATCH_STATE_PRE_DISPATCHED) - $this->dispatchTemplateMethod( - 'PreDispatch', static::DISPATCH_STATE_PRE_DISPATCHED, $submit + $this->dispatchMethods( + $this, 'PreDispatch', + static::DISPATCH_STATE_PRE_DISPATCHED, FALSE ); + if ($state > static::DISPATCH_STATE_RENDERED) $this->dispatchRender(); + $this->dispatchStateSemaphore = FALSE; return TRUE; }