Changeset 1467
- Timestamp:
- 10/18/2006 07:57:08 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 8 modified
-
HISTORY (modified) (1 diff)
-
UPGRADE (modified) (1 diff)
-
framework/Web/Javascripts/js/compressed/validator.js (modified) (2 diffs)
-
framework/Web/Javascripts/js/debug/validator.js (modified) (4 diffs)
-
framework/Web/Javascripts/prado/validation3.js (modified) (4 diffs)
-
framework/Web/UI/ActiveControls/TActiveCustomValidator.php (modified) (2 diffs)
-
framework/Web/UI/WebControls/TBaseValidator.php (modified) (7 diffs)
-
tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r1464 r1467 11 11 NEW: TFeedService, TRssFeedDocument (Knut, Qiang) 12 12 NEW: TJsonService 13 CHG: All validators ClientSide.OnSuccess becomes ClientSide.OnValidationSuccess, and OnSuccess event becomes OnValidationSuccess. (Wei) 14 CHG: All validators ClientSide.OnError becomes ClientSide.OnValidationError, and OnError event becomes OnValidationError. (Wei) 15 13 16 14 17 Version 3.0.5 October 8, 2006 -
trunk/UPGRADE
r1452 r1467 13 13 version B between A and C, you need to following the instructions 14 14 for both A and B. 15 16 17 Upgrading from v3.0.x 18 --------------------- 19 - Validators ClientSide.OnSuccess becomes ClientSide.OnValidationSuccess, 20 - Validators ClientSide.OnError becomes ClientSide.OnValidationError, 21 - Validator OnSuccess event becomes OnValidationSuccess. 22 - Validator OnError event becomes OnValidationError. 23 15 24 16 25 Upgrading from v3.0.4 -
trunk/framework/Web/Javascripts/js/compressed/validator.js
r1466 r1467 106 106 this.isValid=this.evaluateIsValid();else 107 107 this.isValid=true;if(this.isValid) 108 {if(typeof(this.options.On Success)=="function")108 {if(typeof(this.options.OnValidationSuccess)=="function") 109 109 {if(this.requestDispatched==false) 110 {this.refreshControlAndMessage();this.options.On Success(this,invoker);}}110 {this.refreshControlAndMessage();this.options.OnValidationSuccess(this,invoker);}} 111 111 else 112 112 this.updateControl();} 113 113 else 114 {if(typeof(this.options.On Error)=="function")114 {if(typeof(this.options.OnValidationError)=="function") 115 115 {if(this.requestDispatched==false) 116 {this.refreshControlAndMessage();this.options.On Error(this,invoker)}}116 {this.refreshControlAndMessage();this.options.OnValidationError(this,invoker)}} 117 117 else 118 118 this.updateControl();} … … 190 190 {this.validatingValue=value;request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.setCallbackParameter(value);request.setCausesValidation(false);request.options.onSuccess=this.callbackOnSuccess.bind(this);request.options.onFailure=this.callbackOnFailure.bind(this);request.dispatch();this.requestDispatched=true;return false;} 191 191 return this.isValid;},callbackOnSuccess:function(request,data) 192 {this.isValid=data;this.requestDispatched=false; Prado.Validation.validate(this.options.FormID,this.group,null);if(typeof(this.options.onSuccess)=="function")193 this.options.onSuccess(request,data); },callbackOnFailure:function(request,data)192 {this.isValid=data;this.requestDispatched=false;if(typeof(this.options.onSuccess)=="function") 193 this.options.onSuccess(request,data);Prado.Validation.validate(this.options.FormID,this.group,null);},callbackOnFailure:function(request,data) 194 194 {this.requestDispatched=false;if(typeof(this.options.onFailure)=="function") 195 195 this.options.onFailure(request,data);}});Prado.WebUI.TRangeValidator=Class.extend(Prado.WebUI.TBaseValidator,{evaluateIsValid:function() -
trunk/framework/Web/Javascripts/js/debug/validator.js
r1466 r1467 572 572 * options['ControlCssClass'] Css class to use on the input upon error 573 573 * options['OnValidate'] Function to call immediately after validation 574 * options['On Success'] Function to call upon after successful validation575 * options['On Error'] Function to call upon after error in validation.574 * options['OnValidationSuccess'] Function to call upon after successful validation 575 * options['OnValidationError'] Function to call upon after error in validation. 576 576 * options['ObserveChanges'] True to observe changes in input 577 577 * </code> … … 686 686 if(this.isValid) 687 687 { 688 if(typeof(this.options.On Success) == "function")688 if(typeof(this.options.OnValidationSuccess) == "function") 689 689 { 690 690 if(this.requestDispatched == false) 691 691 { 692 692 this.refreshControlAndMessage(); 693 this.options.On Success(this, invoker);693 this.options.OnValidationSuccess(this, invoker); 694 694 } 695 695 } … … 699 699 else 700 700 { 701 if(typeof(this.options.On Error) == "function")701 if(typeof(this.options.OnValidationError) == "function") 702 702 { 703 703 if(this.requestDispatched == false) 704 704 { 705 705 this.refreshControlAndMessage(); 706 this.options.On Error(this, invoker)706 this.options.OnValidationError(this, invoker) 707 707 } 708 708 } … … 1144 1144 this.isValid = data; 1145 1145 this.requestDispatched = false; 1146 Prado.Validation.validate(this.options.FormID, this.group,null);1147 1146 if(typeof(this.options.onSuccess) == "function") 1148 1147 this.options.onSuccess(request,data); 1148 Prado.Validation.validate(this.options.FormID, this.group,null); 1149 1149 }, 1150 1150 -
trunk/framework/Web/Javascripts/prado/validation3.js
r1466 r1467 572 572 * options['ControlCssClass'] Css class to use on the input upon error 573 573 * options['OnValidate'] Function to call immediately after validation 574 * options['On Success'] Function to call upon after successful validation575 * options['On Error'] Function to call upon after error in validation.574 * options['OnValidationSuccess'] Function to call upon after successful validation 575 * options['OnValidationError'] Function to call upon after error in validation. 576 576 * options['ObserveChanges'] True to observe changes in input 577 577 * </code> … … 686 686 if(this.isValid) 687 687 { 688 if(typeof(this.options.On Success) == "function")688 if(typeof(this.options.OnValidationSuccess) == "function") 689 689 { 690 690 if(this.requestDispatched == false) 691 691 { 692 692 this.refreshControlAndMessage(); 693 this.options.On Success(this, invoker);693 this.options.OnValidationSuccess(this, invoker); 694 694 } 695 695 } … … 699 699 else 700 700 { 701 if(typeof(this.options.On Error) == "function")701 if(typeof(this.options.OnValidationError) == "function") 702 702 { 703 703 if(this.requestDispatched == false) 704 704 { 705 705 this.refreshControlAndMessage(); 706 this.options.On Error(this, invoker)706 this.options.OnValidationError(this, invoker) 707 707 } 708 708 } … … 1144 1144 this.isValid = data; 1145 1145 this.requestDispatched = false; 1146 Prado.Validation.validate(this.options.FormID, this.group,null);1147 1146 if(typeof(this.options.onSuccess) == "function") 1148 1147 this.options.onSuccess(request,data); 1148 Prado.Validation.validate(this.options.FormID, this.group,null); 1149 1149 }, 1150 1150 -
trunk/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
r1458 r1467 172 172 173 173 /** 174 * Client-side OnSuccess event is raise after validation is successfull. 175 * This will override the default client-side validator behaviour. 176 * @param string javascript code for client-side OnSuccess event. 177 */ 178 public function setOnValidationSuccess($javascript) 179 { 180 $this->setFunction('OnValidationSuccess', $javascript); 181 } 182 183 /** 184 * @return string javascript code for client-side OnSuccess event. 185 */ 186 public function getOnValidationSuccess() 187 { 188 return $this->getOption('OnValidationSuccess'); 189 } 190 191 /** 174 192 * Client-side OnError event is raised after validation failure. 175 193 * This will override the default client-side validator behaviour. 176 194 * @param string javascript code for client-side OnError event. 177 195 */ 178 public function setOn Error($javascript)179 { 180 $this->setFunction('On Error', $javascript);196 public function setOnValidationError($javascript) 197 { 198 $this->setFunction('OnValidationError', $javascript); 181 199 } 182 200 … … 184 202 * @return string javascript code for client-side OnError event. 185 203 */ 186 public function getOn Error()187 { 188 return $this->getOption('On Error');204 public function getOnValidationError() 205 { 206 return $this->getOption('OnValidationError'); 189 207 } 190 208 -
trunk/framework/Web/UI/WebControls/TBaseValidator.php
r1458 r1467 491 491 { 492 492 $this->setIsValid(true); 493 $this->on Success();493 $this->onValidationSuccess(); 494 494 } 495 495 else 496 496 { 497 497 $this->setIsValid(false); 498 $this->on Error();498 $this->onValidationError(); 499 499 } 500 500 } … … 528 528 * This event is raised when the validator succeeds in validation. 529 529 */ 530 public function on Success()531 { 532 $this->raiseEvent('On Success',$this,null);530 public function onValidationSuccess() 531 { 532 $this->raiseEvent('OnValidationSuccess',$this,null); 533 533 } 534 534 … … 536 536 * This event is raised when the validator fails in validation. 537 537 */ 538 public function on Error()539 { 540 $this->raiseEvent('On Error',$this,null);538 public function onValidationError() 539 { 540 $this->raiseEvent('OnValidationError',$this,null); 541 541 } 542 542 … … 617 617 public function setOnSuccess($javascript) 618 618 { 619 $this->setFunction('On Success', $javascript);619 $this->setFunction('OnValidationSuccess', $javascript); 620 620 } 621 621 … … 625 625 public function getOnSuccess() 626 626 { 627 return $this->getOption('On Success');627 return $this->getOption('OnValidationSuccess'); 628 628 } 629 629 … … 635 635 public function setOnError($javascript) 636 636 { 637 $this->setFunction('On Error', $javascript);637 $this->setFunction('OnValidationError', $javascript); 638 638 } 639 639 … … 643 643 public function getOnError() 644 644 { 645 return $this->getOption('OnError'); 645 return $this->getOption('OnValidationError'); 646 } 647 648 649 /** 650 * Alias for OnSuccess 651 * @param string javascript code for client-side OnSuccess event. 652 */ 653 public function setOnValidationSuccess($javascript) 654 { 655 $this->setOnSuccess($javascript); 656 } 657 658 /** 659 * @return string javascript code for client-side OnSuccess event. 660 */ 661 public function getOnValidationSuccess() 662 { 663 return $this->getOnSuccess(); 664 } 665 666 /** 667 * Alias for OnError 668 * @param string javascript code for client-side OnError event. 669 */ 670 public function setOnValidationError($javascript) 671 { 672 $this->setOnError($javascript); 673 } 674 675 /** 676 * @return string javascript code for client-side OnError event. 677 */ 678 public function getOnValidationError() 679 { 680 return $this->getOnError(); 646 681 } 647 682 -
trunk/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
r1458 r1467 26 26 OnServerValidate="validate_text1"> 27 27 <prop:ClientSide 28 On Error="$('status').innerHTML='Error '+(new Date())"29 On Success="$('status').innerHTML='Success '+(new Date())"28 OnValidationError="$('status').innerHTML='Error '+(new Date())" 29 OnValidationSuccess="$('status').innerHTML='Success '+(new Date())" 30 30 OnLoading="Element.show('loader')" 31 31 OnComplete="Element.hide('loader')" />
