From ace9c57b1c50709bbe8085e9cf99161a4c574be2 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Sun, 28 Jan 2007 01:22:37 +0000
Subject: Fixed TActiveListBox bug. Add more meta for active record. Fix
TCallback docs.
---
framework/Web/UI/ActiveControls/TActiveListBox.php | 4 ++++
framework/Web/UI/ActiveControls/TBaseActiveControl.php | 17 ++++++++++++++++-
framework/Web/UI/ActiveControls/TCallback.php | 3 ++-
3 files changed, 22 insertions(+), 2 deletions(-)
(limited to 'framework/Web/UI/ActiveControls')
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 dispatch() method on the
* request instance. Example code in javascript
*
- * request = <%= $this->mycallback->ActiveControl->Javascript %>;
+ * var request = <%= $this->mycallback->ActiveControl->Javascript %>;
* request.setParameter('hello');
* request.dispatch(); //make the callback request.
*
+ *
+ * Alternatively,
+ *
+ * //dispatches immediately
+ * Prado.Callback("<%= $this->mycallback->UniqueID %>",
+ * $this->mycallback->ActiveControl->JsCallbackOptions);
+ *
* @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');
*
*