summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorwei <>2006-09-10 01:03:56 +0000
committerwei <>2006-09-10 01:03:56 +0000
commitf1f33db1f85c0893205a4a00c203d884dc1af1a5 (patch)
treede0fd5a1b52572708209c98370c9061a19ec5193 /framework
parentfa760c403236b6fe7fdfd5785e2cd34764c24755 (diff)
Changed TCallbackEventParameter::Parameter to TCallbackEventParameter::CallbackParameter
Add TActiveButton and TActiveCheckBox quickstart docs.
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/Javascripts/js/compressed/ajax.js9
-rw-r--r--framework/Web/Javascripts/js/debug/ajax.js9
-rw-r--r--framework/Web/Javascripts/prado/activecontrols3.js5
-rw-r--r--framework/Web/Javascripts/prado/ajax3.js4
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCheckBox.php2
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCustomValidator.php2
-rw-r--r--framework/Web/UI/ActiveControls/TActivePageAdapter.php10
-rw-r--r--framework/Web/UI/ActiveControls/TAutoComplete.php6
-rw-r--r--framework/Web/UI/ActiveControls/TInPlaceTextBox.php2
9 files changed, 26 insertions, 23 deletions
diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js
index 69652e6a..88a0a4b0 100644
--- a/framework/Web/Javascripts/js/compressed/ajax.js
+++ b/framework/Web/Javascripts/js/compressed/ajax.js
@@ -77,8 +77,8 @@ Ajax.Responders.register({onComplete:function(request)
Prado.CallbackRequest.abortRequestInProgress();}});Event.OnLoad(function()
{if(typeof Logger!="undefined")
Ajax.Responders.register(Prado.CallbackRequest.Exception);});Prado.CallbackRequest.prototype={url:window.location.href,options:{},id:null,request:null,initialize:function(id,options)
-{this.id=id;this.options=Object.extend({RequestTimeOut:30000,EnablePageStateUpdate:true,HasPriority:true,CausesValidation:true,ValidationGroup:null,PostInputs:true},options||{});},setParameter:function(value)
-{this.options['params']=value;},getParameter:function()
+{this.id=id;this.options=Object.extend({RequestTimeOut:30000,EnablePageStateUpdate:true,HasPriority:true,CausesValidation:true,ValidationGroup:null,PostInputs:true},options||{});},setCallbackParameter:function(value)
+{this.options['params']=value;},getCallbackParameter:function()
{return this.options['params'];},setRequestTimeOut:function(timeout)
{this.options['RequestTimeOut']=timeout;},getRequestTimeOut:function()
{return this.options['RequestTimeOut'];},setCausesValidation:function(validate)
@@ -203,7 +203,8 @@ this.leaveEditMode();Event.stopObserving(this.element,'click',this.onclickListen
this.editField=this.cached_selectTag;if(this.options.loadTextURL)this.loadExternalText();this.form.appendChild(this.editField);this.options.callback=function(form,value){return"value="+encodeURIComponent(value);}}});Form.Element.DelayedObserver=Class.create();Form.Element.DelayedObserver.prototype={initialize:function(element,delay,callback){this.delay=delay||0.5;this.element=$(element);this.callback=callback;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));},delayedListener:function(event){if(this.lastValue==$F(this.element))return;if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element);},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element));}};Prado.WebUI.CallbackControl=Class.extend(Prado.WebUI.PostBackControl,{onPostBack:function(event,options)
{request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TActiveButton=Class.extend(Prado.WebUI.CallbackControl);Prado.WebUI.TActiveLinkButton=Class.extend(Prado.WebUI.CallbackControl);Prado.WebUI.TActiveImageButton=Class.extend(Prado.WebUI.TImageButton,{onPostBack:function(event,options)
{this.addXYInput(event,options);request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TActiveCheckBox=Class.extend(Prado.WebUI.CallbackControl,{onPostBack:function(event,options)
-{request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();}});Prado.WebUI.TActiveRadioButton=Class.extend(Prado.WebUI.TActiveCheckBox);Prado.WebUI.TActiveTextBox=Class.extend(Prado.WebUI.TTextBox,{onInit:function(options)
+{request=new Prado.CallbackRequest(options.EventTarget,options);if(request.dispatch()==false)
+Event.stop(event);}});Prado.WebUI.TActiveRadioButton=Class.extend(Prado.WebUI.TActiveCheckBox);Prado.WebUI.TActiveTextBox=Class.extend(Prado.WebUI.TTextBox,{onInit:function(options)
{if(options['TextMode']!='MultiLine')
Event.observe(this.element,"keydown",this.handleReturnKey.bind(this));Event.observe(this.element,"change",this.doCallback.bindEvent(this,options));},doCallback:function(event,options)
{request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TAutoComplete=Class.extend(Autocompleter.Base,Prado.WebUI.TActiveTextBox.prototype);Prado.WebUI.TAutoComplete=Class.extend(Prado.WebUI.TAutoComplete,{initialize:function(options)
@@ -248,7 +249,7 @@ Event.stop(event);}});Prado.WebUI.TValueTriggeredCallback=Base.extend({count:1,o
else
this.count=this.count+this.options.Decay;if(this.observing)
this.time=setTimeout(this.checkChanges.bind(this),parseInt(this.options.Interval*1000*this.count));}},doCallback:function(oldValue,newValue)
-{request=new Prado.CallbackRequest(this.options.EventTarget,this.options);param={'OldValue':oldValue,'NewValue':newValue};request.setParameter(param);request.dispatch();}},{timers:{},register:function(timer)
+{request=new Prado.CallbackRequest(this.options.EventTarget,this.options);param={'OldValue':oldValue,'NewValue':newValue};request.setCallbackParameter(param);request.dispatch();}},{timers:{},register:function(timer)
{this.timers[timer.options.ID]=timer;},stop:function(id)
{if(this.timers[id])
this.timers[id].stopObserving();}});Prado.WebUI.TInPlaceTextBox=Base.extend({isSaving:false,isEditing:false,editField:null,constructor:function(options)
diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js
index 7d99cb57..9835e7e8 100644
--- a/framework/Web/Javascripts/js/debug/ajax.js
+++ b/framework/Web/Javascripts/js/debug/ajax.js
@@ -670,7 +670,7 @@ Prado.CallbackRequest.prototype =
* Sets the request parameter
* @param {Object} parameter value
*/
- setParameter : function(value)
+ setCallbackParameter : function(value)
{
this.options['params'] = value;
},
@@ -678,7 +678,7 @@ Prado.CallbackRequest.prototype =
/**
* @return {Object} request paramater value.
*/
- getParameter : function()
+ getCallbackParameter : function()
{
return this.options['params'];
},
@@ -2026,7 +2026,8 @@ Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl,
onPostBack : function(event, options)
{
request = new Prado.CallbackRequest(options.EventTarget, options);
- request.dispatch();
+ if(request.dispatch()==false)
+ Event.stop(event);
}
});
@@ -2316,7 +2317,7 @@ Prado.WebUI.TValueTriggeredCallback = Base.extend(
{
request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
param = {'OldValue' : oldValue, 'NewValue' : newValue};
- request.setParameter(param);
+ request.setCallbackParameter(param);
request.dispatch();
}
},
diff --git a/framework/Web/Javascripts/prado/activecontrols3.js b/framework/Web/Javascripts/prado/activecontrols3.js
index 80c5fc67..e608e71e 100644
--- a/framework/Web/Javascripts/prado/activecontrols3.js
+++ b/framework/Web/Javascripts/prado/activecontrols3.js
@@ -38,7 +38,8 @@ Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl,
onPostBack : function(event, options)
{
request = new Prado.CallbackRequest(options.EventTarget, options);
- request.dispatch();
+ if(request.dispatch()==false)
+ Event.stop(event);
}
});
@@ -328,7 +329,7 @@ Prado.WebUI.TValueTriggeredCallback = Base.extend(
{
request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
param = {'OldValue' : oldValue, 'NewValue' : newValue};
- request.setParameter(param);
+ request.setCallbackParameter(param);
request.dispatch();
}
},
diff --git a/framework/Web/Javascripts/prado/ajax3.js b/framework/Web/Javascripts/prado/ajax3.js
index a11fe1aa..397382f3 100644
--- a/framework/Web/Javascripts/prado/ajax3.js
+++ b/framework/Web/Javascripts/prado/ajax3.js
@@ -382,7 +382,7 @@ Prado.CallbackRequest.prototype =
* Sets the request parameter
* @param {Object} parameter value
*/
- setParameter : function(value)
+ setCallbackParameter : function(value)
{
this.options['params'] = value;
},
@@ -390,7 +390,7 @@ Prado.CallbackRequest.prototype =
/**
* @return {Object} request paramater value.
*/
- getParameter : function()
+ getCallbackParameter : function()
{
return this.options['params'];
},
diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBox.php b/framework/Web/UI/ActiveControls/TActiveCheckBox.php
index d6de63e3..7cf5c005 100644
--- a/framework/Web/UI/ActiveControls/TActiveCheckBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveCheckBox.php
@@ -148,7 +148,7 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv
protected function getDefaultLabelID()
{
if($attributes=$this->getViewState('LabelAttributes',null))
- return $this->getLabelAttributes()->itemAt('id');
+ return TCheckBox::getLabelAttributes()->itemAt('id');
else
return $this->getClientID().'_label';
}
diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
index 7c4ab16b..80e594e2 100644
--- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
+++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
@@ -85,7 +85,7 @@ class TActiveCustomValidator extends TCustomValidator
public function raiseCallbackEvent($param)
{
$this->_isCallback = true;
- $result = $this->onServerValidate($param->getParameter());
+ $result = $this->onServerValidate($param->getCallbackParameter());
$param->setData($result);
$this->onCallback($param);
}
diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
index c3ca8947..9274ddb7 100644
--- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
@@ -242,7 +242,7 @@ class TActivePageAdapter extends TControlAdapter
* TCallbackEventParameter class.
*
* The TCallbackEventParameter provides the parameter passed during the callback
- * requestion in the {@link getParameter Parameter} property. The
+ * requestion in the {@link getCallbackParameter CallbackParameter} property. The
* callback response content (e.g. new HTML content) must be rendered
* using an THtmlWriter obtained from the {@link getNewWriter NewWriter}
* property, which returns a <b>NEW</b> instance of TCallbackResponseWriter.
@@ -253,7 +253,7 @@ class TActivePageAdapter extends TControlAdapter
* use the same writer instance for the panels to be rendered.
*
* The response data (i.e., passing results back to the client-side
- * callback handler function) can be set using {@link setData Data} property.
+ * callback handler function) can be set using {@link setResponseData ResponseData} property.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @version $Id$
@@ -291,7 +291,7 @@ class TCallbackEventParameter extends TEventParameter
/**
* @return mixed callback request parameter.
*/
- public function getParameter()
+ public function getCallbackParameter()
{
return $this->_parameter;
}
@@ -299,7 +299,7 @@ class TCallbackEventParameter extends TEventParameter
/**
* @param mixed callback response data.
*/
- public function setData($value)
+ public function setResponesData($value)
{
$this->_response->getAdapter()->setResponseData($value);
}
@@ -307,7 +307,7 @@ class TCallbackEventParameter extends TEventParameter
/**
* @return mixed callback response data.
*/
- public function getData()
+ public function getResponesData()
{
return $this->_response->getAdapter()->getResponseData();
}
diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php
index dadb723a..080bb410 100644
--- a/framework/Web/UI/ActiveControls/TAutoComplete.php
+++ b/framework/Web/UI/ActiveControls/TAutoComplete.php
@@ -29,7 +29,7 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
*
* The list of suggestions should be set in the {@link onSuggestion OnSuggestion}
* event handler. The partial word to match the suggestion is in the
- * {@link TCallbackEventParameter::getParameter TCallbackEventParameter::Parameter}
+ * {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter}
* property. The datasource of the TAutoComplete must be set using {@link setDataSource}
* method. This sets the datasource for the suggestions repeater, available through
* the {@link getSuggestions Suggestions} property. Header, footer templates and
@@ -41,7 +41,7 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
* <code>
* function autocomplete_suggestion($sender, $param)
* {
- * $token = $param->getParameter(); //the partial word to match
+ * $token = $param->getCallbackParameter(); //the partial word to match
* $sender->setDataSource($this->getSuggestionsFor($token)); //set suggestions
* $sender->dataBind();
* $sender->render($param->getNewWriter()); //sends suggestion back to browser.
@@ -138,7 +138,7 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer
*/
public function raiseCallbackEvent($param)
{
- $token = $param->getParameter();
+ $token = $param->getCallbackParameter();
if(is_array($token) && count($token) == 2 && $token[1] === '__TAutoComplete_onSuggest__')
{
$parameter = new TCallbackEventParameter($this->getResponse(), $token[0]);
diff --git a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
index 5bfd9456..236e43d5 100644
--- a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
+++ b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
@@ -162,7 +162,7 @@ class TInPlaceTextBox extends TActiveTextBox
*/
public function onCallback($param)
{
- $action = $param->getParameter();
+ $action = $param->getCallbackParameter();
if(is_array($action) && $action[0] === '__InlineEditor_loadExternalText__')
{
$parameter = new TCallbackEventParameter($this->getResponse(), $action[1]);