From 81fc5eee82a692b88fa6ae687ee3d33b668fd747 Mon Sep 17 00:00:00 2001
From: "ctrlaltca@gmail.com" <>
Date: Tue, 15 Nov 2011 17:33:22 +0000
Subject: dirty test patch for #372, open for comments
---
.../Web/UI/ActiveControls/TActiveControlAdapter.php | 11 ++++++++---
framework/Web/UI/TControl.php | 20 ++++++++++----------
framework/Web/UI/TControlAdapter.php | 4 ++--
3 files changed, 20 insertions(+), 15 deletions(-)
(limited to 'framework')
diff --git a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
index 99c5e71e..13f32ddb 100644
--- a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
@@ -90,7 +90,12 @@ class TActiveControlAdapter extends TControlAdapter
public function render($writer)
{
$this->renderCallbackClientScripts();
- parent::render($writer);
+ if($this->_control->getVisible(false))
+ {
+ parent::render($writer);
+ } else {
+ $writer->write("_control->getClientID()."\" >");
+ }
}
/**
@@ -341,9 +346,9 @@ class TCallbackPageStateTracker
protected function updateVisible($visible)
{
if($visible === false)
- $this->client()->hide($this->_control);
+ $this->client()->replaceContent($this->_control,"_control->getClientID()."\" >");
else
- $this->client()->show($this->_control);
+ $this->client()->replaceContent($this->_control,$this->_control);
}
/**
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 79040dda..374c2aee 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2011 PradoSoft
+ * @copyright Copyright © 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI
@@ -1533,7 +1533,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
*/
public function renderControl($writer)
{
- if($this->getVisible(false))
+ if($this instanceof IActiveControl || $this->getVisible(false))
{
if(isset($this->_rf[self::RF_ADAPTER]))
$this->_rf[self::RF_ADAPTER]->render($writer);
@@ -1997,14 +1997,14 @@ interface IValidatable
* @return mixed the value of the property to be validated.
*/
public function getValidationPropertyValue();
- /**
- * @return boolean wether this control's validators validated successfully (must default to true)
- */
- public function getIsValid();
- /**
- * @return boolean wether this control's validators validated successfully
- */
- public function setIsValid($value);
+ /**
+ * @return boolean wether this control's validators validated successfully (must default to true)
+ */
+ public function getIsValid();
+ /**
+ * @return boolean wether this control's validators validated successfully
+ */
+ public function setIsValid($value);
}
/**
diff --git a/framework/Web/UI/TControlAdapter.php b/framework/Web/UI/TControlAdapter.php
index bdf40b47..da563443 100644
--- a/framework/Web/UI/TControlAdapter.php
+++ b/framework/Web/UI/TControlAdapter.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2011 PradoSoft
+ * @copyright Copyright © 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI
@@ -26,7 +26,7 @@ class TControlAdapter extends TApplicationComponent
/**
* @var TControl the control to which the adapter is attached
*/
- private $_control;
+ protected $_control;
/**
* Constructor.
--
cgit v1.2.3