From ca22da21b0cedab985e698f4dedf3ac1158a1487 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 20 Jan 2015 23:42:12 +0100 Subject: one class per file: framework/Web/UI/WebControls --- .../Web/UI/WebControls/TValidatorClientSide.php | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 framework/Web/UI/WebControls/TValidatorClientSide.php (limited to 'framework/Web/UI/WebControls/TValidatorClientSide.php') diff --git a/framework/Web/UI/WebControls/TValidatorClientSide.php b/framework/Web/UI/WebControls/TValidatorClientSide.php new file mode 100644 index 00000000..84bfd2f6 --- /dev/null +++ b/framework/Web/UI/WebControls/TValidatorClientSide.php @@ -0,0 +1,106 @@ + + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Web.UI.WebControls + */ + +/** + * TValidatorClientSide class. + * + * Client-side validator events can be modified through the {@link + * TBaseValidator::getClientSide ClientSide} property of a validator. The + * subproperties of ClientSide are those of the TValidatorClientSide + * properties. The client-side validator supports the following events. + * + * The OnValidate event is raise before the validator validation + * functions are called. + * + * The OnValidationSuccess event is raised after the validator has successfully + * validate the control. + * + * The OnValidationError event is raised after the validator fails validation. + * + * See the quickstart documentation for further details. + * + * @author Wei Zhuo + * @package System.Web.UI.WebControls + * @since 3.0 + */ +class TValidatorClientSide extends TClientSideOptions +{ + /** + * @return string javascript code for client-side OnValidate event. + */ + public function getOnValidate() + { + return $this->getOption('OnValidate'); + } + + /** + * Client-side OnValidate validator event is raise before the validators + * validation functions are called. + * @param string javascript code for client-side OnValidate event. + */ + public function setOnValidate($javascript) + { + $this->setFunction('OnValidate', $javascript); + } + + /** + * Client-side OnSuccess event is raise after validation is successfull. + * This will override the default client-side validator behaviour. + * @param string javascript code for client-side OnSuccess event. + */ + public function setOnValidationSuccess($javascript) + { + $this->setFunction('OnValidationSuccess', $javascript); + } + + /** + * @return string javascript code for client-side OnSuccess event. + */ + public function getOnValidationSuccess() + { + return $this->getOption('OnValidationSuccess'); + } + + /** + * Client-side OnError event is raised after validation failure. + * This will override the default client-side validator behaviour. + * @param string javascript code for client-side OnError event. + */ + public function setOnValidationError($javascript) + { + $this->setFunction('OnValidationError', $javascript); + } + + /** + * @return string javascript code for client-side OnError event. + */ + public function getOnValidationError() + { + return $this->getOption('OnValidationError'); + } + + /** + * @param boolean true to revalidate when the control to validate changes value. + */ + public function setObserveChanges($value) + { + $this->setOption('ObserveChanges', TPropertyValue::ensureBoolean($value)); + } + + /** + * @return boolean true to observe changes. + */ + public function getObserveChanges() + { + $changes = $this->getOption('ObserveChanges'); + return ($changes===null) ? true : $changes; + } +} \ No newline at end of file -- cgit v1.2.3