diff options
Diffstat (limited to 'framework/Web/Javascripts')
3 files changed, 43 insertions, 18 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js index 3aacda21..e96b63ec 100755 --- a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js @@ -46,9 +46,9 @@ Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker, var day = Prado.WebUI.TDatePicker.getDayListControl(this.control); var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control); var year = Prado.WebUI.TDatePicker.getYearListControl(this.control); - Event.observe (day, "change", this.onDateChanged.bindEvent(this)); - Event.observe (month, "change", this.onDateChanged.bindEvent(this)); - Event.observe (year, "change", this.onDateChanged.bindEvent(this)); + if (day) Event.observe (day, "change", this.onDateChanged.bindEvent(this)); + if (month) Event.observe (month, "change", this.onDateChanged.bindEvent(this)); + if (year) Event.observe (year, "change", this.onDateChanged.bindEvent(this)); } @@ -66,9 +66,12 @@ Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker, } else { - var day = Prado.WebUI.TDatePicker.getDayListControl(this.control).selectedIndex+1; - var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control).selectedIndex; - var year = Prado.WebUI.TDatePicker.getYearListControl(this.control).value; + var day = Prado.WebUI.TDatePicker.getDayListControl(this.control); + if (day) day=day.selectedIndex+1; + var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control); + if (month) month=month.selectedIndex; + var year = Prado.WebUI.TDatePicker.getYearListControl(this.control); + if (year) year=year.value; date=new Date(year, month, day, 0,0,0).SimpleFormat(this.Format, this); } if (typeof(this.options.OnDateChanged) == "function") this.options.OnDateChanged(this, date); diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js index f42a0673..de633c77 100755 --- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js +++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js @@ -46,20 +46,41 @@ Prado.WebUI.TActiveFileUpload = Base.extend( }, finishUpload : function(options){ + + if (this.options.targetID == options.targetID) + { + this.finishoptions = options; + var e = this; + var callback = + { + 'CallbackParameter' : options || '', + 'onSuccess' : function() { e.finishCallBack(true); }, + 'onFailure' : function() { e.finishCallBack(false); } + }; + + Object.extend(callback, this.options); + + request = new Prado.CallbackRequest(this.options.EventTarget, callback); + request.dispatch(); + } + else + this.finishCallBack(true); + + }, + + finishCallBack : function(success){ // hide the display indicator. this.flag.value = ''; this.indicator.style.display = 'none'; - if (this.options.targetID == options.targetID){ - // show the complete indicator. - if (options.errorCode == 0){ - this.complete.style.display = ''; - this.input.value = ''; - } else { - this.error.style.display = ''; - } - Prado.Callback(this.options.EventTarget, options, null, this.options); - } + // show the complete indicator. + if ((this.finishoptions.errorCode == 0) && (success)) { + this.complete.style.display = ''; + this.input.value = ''; + } else { + this.error.style.display = ''; + } } + }, { // class methods diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js index ed9493be..b1bf1a03 100644 --- a/framework/Web/Javascripts/source/prado/validator/validation3.js +++ b/framework/Web/Javascripts/source/prado/validator/validation3.js @@ -795,7 +795,7 @@ Prado.WebUI.TBaseValidator.prototype = * Wether the validator is enabled (default true)
* @var {boolean} enabled
*/
- this.enabled = true;
+ this.enabled = options.Enabled;
/**
* Visibility state of validator(default false)
* @var {boolean} visible
@@ -837,6 +837,7 @@ Prado.WebUI.TBaseValidator.prototype = * @var {element} message
*/
this.message = $(options.ID);
+
Prado.Registry.set(options.ID, this);
if(this.control && this.message)
{
@@ -1706,7 +1707,7 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato if (value.length <= 0)
return true;
- var rx = new RegExp(this.options.ValidationExpression,this.options.PatternModifiers);
+ var rx = new RegExp('^'+this.options.ValidationExpression+'$',this.options.PatternModifiers);
var matches = rx.exec(value);
return (matches != null && value == matches[0]);
}
|