summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-07-21 15:31:21 +0000
committerxue <>2006-07-21 15:31:21 +0000
commitb0744e3ffc412d4f8f706f8e75242509798bf21d (patch)
tree4af330bd387518463b18eeca0b90ccab8be33f36
parenta09f20e18289796f73ab795febc9dff542797ba1 (diff)
fixed #206.
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php9
2 files changed, 7 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 6c5f0f33..dbfd8106 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,7 @@ BUG: Ticket#264 - Typos in some exception throw statements (Knut)
BUG: Ticket#268 - THttpResponse.redirect() may fail for some browsers (Qiang)
BUG: TDataGrid may complain getting ItemType on a non-object if the grid is not data-bound (Qiang)
BUG: TCheckBox.Value should be converted to string (Qiang)
+CHG: Ticket#206 - TBaseValidator.OnValidate is raised only when the validator is visible (Qiang)
ENH: Ticket#220 - TClientScripts method to import custom javascript files (Wei)
ENH: Ticket#225 - TRadioButton::getRadioButtonsInGroup() added (Wei)
ENH: Ticket#223 - Use TRequiredFieldValidator for TRadioButtons with GroupName property (Wei)
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index 9b181a2a..b2405996 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -478,10 +478,10 @@ abstract class TBaseValidator extends TLabel implements IValidator
*/
public function validate()
{
- $this->onValidate();
+ if($visible=$this->getVisible(true))
+ $this->onValidate();
$this->setIsValid(true);
- $control=$this->getValidationTarget();
- if($control && $this->getVisible(true) && $this->getEnabled())
+ if($this->getValidationTarget() && $visible && $this->getEnabled())
{
if($this->evaluateIsValid())
{
@@ -538,6 +538,9 @@ abstract class TBaseValidator extends TLabel implements IValidator
/**
* This event is raised right before the validator starts to perform validation.
+ * You may use this event to change the behavior of validation.
+ * For example, you may disable the validator if certain condition is satisfied.
+ * Note, the event will NOT be raised if the validator is invisible.
*/
public function onValidate()
{