diff options
Diffstat (limited to 'framework/Web/UI')
-rw-r--r-- | framework/Web/UI/ActiveControls/TActiveListBox.php | 4 | ||||
-rw-r--r-- | framework/Web/UI/ActiveControls/TBaseActiveControl.php | 17 | ||||
-rw-r--r-- | framework/Web/UI/ActiveControls/TCallback.php | 3 | ||||
-rw-r--r-- | framework/Web/UI/TPage.php | 2 |
4 files changed, 23 insertions, 3 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveListBox.php b/framework/Web/UI/ActiveControls/TActiveListBox.php index 21816961..97b28ac7 100644 --- a/framework/Web/UI/ActiveControls/TActiveListBox.php +++ b/framework/Web/UI/ActiveControls/TActiveListBox.php @@ -127,6 +127,10 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH { parent::onPreRender($param); $this->getAdapter()->updateListItems(); + $multiple = $this->getIsMultiSelect(); + $id = $this->getUniqueID(); $multi_id = $id.'[]'; + if($multiple) + $this->getPage()->registerPostDataLoader($multi_id); } } diff --git a/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/framework/Web/UI/ActiveControls/TBaseActiveControl.php index 000e896f..ebd9d168 100644 --- a/framework/Web/UI/ActiveControls/TBaseActiveControl.php +++ b/framework/Web/UI/ActiveControls/TBaseActiveControl.php @@ -360,10 +360,17 @@ class TBaseActiveCallbackControl extends TBaseActiveControl * request for this control call the <tt>dispatch()</tt> method on the
* request instance. Example code in javascript
* <code>
- * request = <%= $this->mycallback->ActiveControl->Javascript %>;
+ * var request = <%= $this->mycallback->ActiveControl->Javascript %>;
* request.setParameter('hello');
* request.dispatch(); //make the callback request.
* </code>
+ *
+ * Alternatively,
+ * <code>
+ * //dispatches immediately
+ * Prado.Callback("<%= $this->mycallback->UniqueID %>",
+ * $this->mycallback->ActiveControl->JsCallbackOptions);
+ * </code>
* @return string javascript client-side callback request object (javascript
* code)
*/
@@ -372,6 +379,14 @@ class TBaseActiveCallbackControl extends TBaseActiveControl $client = $this->getPage()->getClientScript();
return $client->getCallbackReference($this->getControl(),$this->getClientSideOptions());
}
+
+ /**
+ * @param string callback requestion options as javascript code.
+ */
+ public function getJsCallbackOptions()
+ {
+ return TJavascript::encode($this->getClientSideOptions());
+ }
}
?>
\ No newline at end of file diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php index 60bdaf10..47d36d54 100644 --- a/framework/Web/UI/ActiveControls/TCallback.php +++ b/framework/Web/UI/ActiveControls/TCallback.php @@ -29,7 +29,8 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * <script type="text/javascript">
* function do_callback1()
* {
- * <%= $this->callback1->ActiveControl->Javascript %>
+ * var request = <%= $this->callback1->ActiveControl->Javascript %>;
+ * request.dispatch();
* }
* </script>
* <div onclick="do_callback1()">Click Me!</div>
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 53c9b03f..96ac6d36 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -846,7 +846,7 @@ class TPage extends TTemplateControl if($control->loadPostData($key,$postData))
$this->_controlsPostDataChanged[]=$control;
}
- else if($control instanceof IPostBackEventHandler &&
+ else if($control instanceof IPostBackEventHandler &&
empty($this->_postData[self::FIELD_POSTBACK_TARGET]))
{
$this->_postData->add(self::FIELD_POSTBACK_TARGET,$key); // not calling setPostBackEventTarget() because the control may be removed later
|