diff options
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/ActiveControls/TCallbackClientScript.php | 9 | ||||
-rw-r--r-- | framework/Web/UI/TPage.php | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php index 19e395df..b10552e8 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -275,6 +275,15 @@ class TCallbackClientScript extends TApplicationComponent }
/**
+ * Focus on a particular element.
+ * @param TControl control element or element id.
+ */
+ public function focus($element)
+ {
+ $this->callClientFunction('Prado.Element.focus', $element);
+ }
+
+ /**
* Sets the style of element. The style must be a key-value array where the
* key is the style property and the value is the style value.
* @param TControl control element or element id
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index dc81ccbb..53c9b03f 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -340,7 +340,10 @@ class TPage extends TTemplateControl */
public function getCallbackClient()
{
- return $this->getAdapter()->getCallbackClientHandler();
+ if($this->getAdapter() !== null)
+ return $this->getAdapter()->getCallbackClientHandler();
+ else
+ return new TCallbackClientScript();
}
/**
|