From a6be5564823be40670e0cad8dc758557dbd37549 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 24 Jun 2006 05:46:22 +0000 Subject: Update active controls. --- framework/Web/UI/TControl.php | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI/TControl.php') diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index d1767d57..34aeb85e 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -1000,20 +1000,44 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable } /** - * @return boolean true if the control has been initialized. + * @return boolean true if the child control has been initialized. */ - public function getIsInitialized() + public function getHasChildInitialized() { return $this->getControlStage() >= self::CS_CHILD_INITIALIZED; } + /** + * @return boolean true if the onInit event has raised. + */ + public function getHasInitialized() + { + return $this->getControlStage() >= self::CS_INITIALIZED; + } + /** * @return boolean true if the control has loaded post data. */ public function getHasLoadedPostData() + { + return $this->getControlStage() >= self::CS_STATE_LOADED; + } + + /** + * @return boolean true if the onLoad event has raised. + */ + public function getHasLoaded() { return $this->getControlStage() >= self::CS_LOADED; } + + /** + * @return boolean true if onPreRender event has raised. + */ + public function getHasPreRendered() + { + return $this->getControlStage() >= self::CS_PRERENDERED; + } /** * Returns the named registered object. @@ -1250,12 +1274,19 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable $control->evaluateDynamicContent(); } } - - if($this instanceof IPostBackDataHandler) - $this->getPage()->registerPostDataLoader($this); + $this->addToPostDataLoader(); } $this->_stage=self::CS_PRERENDERED; } + + /** + * Add controls implementing IPostBackDataHandler to post data loaders. + */ + protected function addToPostDataLoader() + { + if($this instanceof IPostBackDataHandler) + $this->getPage()->registerPostDataLoader($this); + } /** * Performs the Unload step for the control and all its child controls. -- cgit v1.2.3