diff options
Diffstat (limited to 'framework/Web/UI/TControl.php')
| -rw-r--r-- | framework/Web/UI/TControl.php | 22 | 
1 files changed, 21 insertions, 1 deletions
| diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index ce343925..7a123ed2 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -790,7 +790,7 @@ class TControl extends TComponent  	 * The current naming container is either the control itself
  	 * if it implements {@link INamingContainer} or the control's naming container.
  	 * The ID path is an ID sequence separated by {@link TControl::ID_SEPARATOR}.
 -	 * For example, 'Repeater1:Item1:Button1' looks for a control with ID 'Button1'
 +	 * For example, 'Repeater1.Item1.Button1' looks for a control with ID 'Button1'
  	 * whose naming container is 'Item1' whose naming container is 'Repeater1'.
  	 * @param string ID of the control to be looked up
  	 * @return TControl|null the control found, null if not found
 @@ -798,6 +798,7 @@ class TControl extends TComponent  	 */
  	public function findControl($id)
  	{
 +		$id=strtr($id,'.',self::ID_SEPARATOR);
  		$container=($this instanceof INamingContainer)?$this:$this->getNamingContainer();
  		if(!$container || !$container->getHasControls())
  			return null;
 @@ -843,6 +844,25 @@ class TControl extends TComponent  	}
  	/**
 +	 * Unregisters an object by name.
 +	 * @param string name of the object
 +	 * @see registerObject
 +	 */
 +	public function unregisterObject($name)
 +	{
 +		unset($this->_rf[self::RF_NAMED_OBJECTS][$name]);
 +	}
 +
 +	/**
 +	 * @return boolean whether an object has been registered with the name
 +	 * @see registerObject
 +	 */
 +	public function isObjectRegistered($name)
 +	{
 +		return isset($this->_rf[self::RF_NAMED_OBJECTS][$name]);
 +	}
 +
 +	/**
  	 * This method is invoked after the control is instantiated by a template.
  	 * When this method is invoked, the control should have a valid TemplateControl
  	 * and has its properties initialized according to template configurations.
 | 
