summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/TControl.php26
-rw-r--r--framework/Web/UI/TTemplateManager.php8
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php6
-rw-r--r--framework/Web/UI/WebControls/TListControl.php2
4 files changed, 20 insertions, 22 deletions
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 225b6b32..99af06d1 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -999,7 +999,6 @@ class TControl extends TComponent
*/
protected function initRecursive($namingContainer=null)
{
- $this->ensureChildControls();
if($this->getHasControls())
{
if($this instanceof INamingContainer)
@@ -1056,6 +1055,7 @@ class TControl extends TComponent
{
if($this->getVisible(false))
{
+ $this->ensureChildControls();
$this->onPreRender(null);
if($this->getHasControls())
{
@@ -1739,8 +1739,8 @@ class TBroadcastEventParameter extends TEventParameter
*
* TCommandEventParameter encapsulates the parameter data for <b>Command</b>
* event of button controls. You can access the name of the command via
- * <b>Name</b> property, and the parameter carried with the command via
- * <b>Parameter</b> property.
+ * {@link getCommandName CommandName} property, and the parameter carried
+ * with the command via {@link getCommandParameter CommandParameter} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
@@ -1766,34 +1766,18 @@ class TCommandEventParameter extends TEventParameter
/**
* @return string name of the command
*/
- public function getName()
+ public function getCommandName()
{
return $this->_name;
}
/**
- * @param string name of the command
- */
- public function setName($value)
- {
- $this->_name=$value;
- }
-
- /**
* @return string parameter of the command
*/
- public function getParameter()
+ public function getCommandParameter()
{
return $this->_param;
}
-
- /**
- * @param string parameter of the command
- */
- public function setParameter($value)
- {
- $this->_param=$value;
- }
}
?> \ No newline at end of file
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index d03a15d6..6bf9bc02 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -201,6 +201,14 @@ class TTemplate extends TComponent implements ITemplate
}
/**
+ * @return string context directory path
+ */
+ public function getContextPath()
+ {
+ return $this->_contextPath;
+ }
+
+ /**
* @return array name-value pairs declared in the directive
*/
public function getDirective()
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index d82150ca..1f1d0b1b 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -105,6 +105,12 @@ abstract class TBaseValidator extends TLabel implements IValidator
$this->getPage()->getValidators()->add($this);
}
+ protected function onUnload($param)
+ {
+ $this->getPage()->getValidators()->remove($this);
+ parent::onUnload($param);
+ }
+
/**
* Adds attributes to renderer.
* @param THtmlWriter the renderer
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index 265c320b..e1384d54 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -149,6 +149,7 @@ abstract class TListControl extends TDataBoundControl
*/
protected function performDataBinding($data)
{
+ $items=$this->getItems();
if(!$this->getAppendDataBoundItems())
$items->clear();
if($data instanceof Traversable)
@@ -160,7 +161,6 @@ abstract class TListControl extends TDataBoundControl
if($valueField==='')
$valueField=1;
$textFormat=$this->getDataTextFormatString();
- $items=$this->getItems();
foreach($data as $object)
{
$item=new TListItem;