diff options
author | xue <> | 2006-04-09 15:18:05 +0000 |
---|---|---|
committer | xue <> | 2006-04-09 15:18:05 +0000 |
commit | bfa60270a735a7a08a545a9bc1c972e8bf0bc590 (patch) | |
tree | 032f3bb44f1cbf96cf3c311082a3a32b146ca277 /framework/Web/UI/TControl.php | |
parent | d8122a0f98137822b0ea20f7602d105fcb2fe962 (diff) |
Fixed a bug about determining the cache key in TOutputCache.
Diffstat (limited to 'framework/Web/UI/TControl.php')
-rw-r--r-- | framework/Web/UI/TControl.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index f5f77513..cc6a6740 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -130,7 +130,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable /**
* @var string control unique ID
*/
- private $_uid='';
+ private $_uid=null;
/**
* @var TControl parent of the control
*/
@@ -366,8 +366,9 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable */
public function getUniqueID()
{
- if($this->_uid==='') // need to build the UniqueID
+ if($this->_uid==='' || $this->_uid===null) // need to build the UniqueID
{
+ $this->_uid=''; // set to not-null, so that clearCachedUniqueID() may take action
if($namingContainer=$this->getNamingContainer())
{
if($this->getPage()===$namingContainer)
@@ -1062,6 +1063,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable $control->generateAutomaticID();
else
$namingContainer->clearNameTable();
+ $control->clearCachedUniqueID($control instanceof INamingContainer);
}
if($this->_stage>=self::CS_CHILD_INITIALIZED)
@@ -1557,13 +1559,13 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable */
private function clearCachedUniqueID($recursive)
{
- $this->_uid='';
- if($recursive && isset($this->_rf[self::RF_CONTROLS]))
+ if($recursive && $this->_uid!==null && isset($this->_rf[self::RF_CONTROLS]))
{
foreach($this->_rf[self::RF_CONTROLS] as $control)
if($control instanceof TControl)
$control->clearCachedUniqueID($recursive);
}
+ $this->_uid=null;
}
/**
|