summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
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/Web/Javascripts
parentfa760c403236b6fe7fdfd5785e2cd34764c24755 (diff)
Changed TCallbackEventParameter::Parameter to TCallbackEventParameter::CallbackParameter
Add TActiveButton and TActiveCheckBox quickstart docs.
Diffstat (limited to 'framework/Web/Javascripts')
-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
4 files changed, 15 insertions, 12 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'];
},