From 91fe694c8755aa2d05743946a3681be7232420b6 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Mon, 4 Dec 2006 00:17:43 +0000
Subject: propage changes to OnError and OnSuccess for validators ClientSide.
---
demos/quickstart/protected/pages/Controls/Validation.page | 8 ++++----
.../protected/pages/Sessioned/PageStateTest.page | 4 ++--
.../protected/pages/Sessioned/PageStateTest.php | 5 +++--
.../features/protected/pages/ValidatorEffects.page | 12 ++++++------
tests/FunctionalTests/tickets/protected/pages/Ticket205.page | 2 +-
tests/FunctionalTests/tickets/protected/pages/Ticket207.page | 2 +-
6 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/demos/quickstart/protected/pages/Controls/Validation.page b/demos/quickstart/protected/pages/Controls/Validation.page
index 2405fb45..0e4006bb 100644
--- a/demos/quickstart/protected/pages/Controls/Validation.page
+++ b/demos/quickstart/protected/pages/Controls/Validation.page
@@ -156,8 +156,8 @@ The summary can be displayed as a list, a bulleted list, or a single paragraph b
All validators contains the following events.
- The OnValidate event is raise before the validator validation functions are called.
- - The OnSuccess event is raised after the validator has successfully validate the control.
- - The OnError event is raised after the validator fails validation.
+ - The OnValidationSuccess event is raised after the validator has successfully validate the control.
+ - The OnValidationError event is raised after the validator fails validation.
The corresponding events for the client side is available as sub-properties
of the ClientSide property of the validator.
@@ -165,9 +165,9 @@ The summary can be displayed as a list, a bulleted list, or a single paragraph b
The following example pop-up a message saying "hello" when the validator fails on the client-side.
<com:TRequiredFieldValidator ... >
- <prop:ClientSide.OnError>
+ <prop:ClientSide.OnValidationError>
alert("hello");
- </prop:ClientSide.OnError>
+ </prop:ClientSide.OnValidationError>
</com:TRequiredFieldValidator>
The resulting client-side event callback function is of the following form.
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
index 5d7f451b..fdd4a604 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
@@ -2,8 +2,8 @@
+ CustomData="0"
+ Text="Click Me!" OnClick="button1_oncallback" />
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php
index abb6c8c8..4a488107 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php
@@ -4,8 +4,9 @@ class PageStateTest extends TPage
{
function button1_oncallback($sender, $param)
{
- sleep(rand(0,5));
- $this->label1->Text .= " button1 clicked ";
+ //sleep(rand(0,5));
+ $sender->CustomData = $sender->CustomData + 1;
+ $this->label1->Text = " button1 clicked ".$sender->CustomData." times";
}
}
diff --git a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page
index e01b542e..78c66365 100644
--- a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page
+++ b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page
@@ -16,13 +16,13 @@
ControlCssClass="required"
Display="Dynamic"
ErrorMessage="a username is required.">
-
+
Effect.Shake(sender.control);
Effect.Appear(sender.message);
-
-
+
+
Effect.Fade(sender.message);
-
+
@@ -37,8 +37,8 @@
ValidationGroup="registration"
ControlCssClass="required"
Display="Dynamic"
- ClientSide.OnError="sender.message.visualEffect('appear')"
- ClientSide.OnSuccess="sender.message.visualEffect('fade')"
+ ClientSide.OnValidationError="sender.message.visualEffect('appear')"
+ ClientSide.OnValidationSuccess="sender.message.visualEffect('fade')"
ErrorMessage="a password is required." />
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket205.page b/tests/FunctionalTests/tickets/protected/pages/Ticket205.page
index 5735b22a..376f97f7 100644
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket205.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket205.page
@@ -1,5 +1,5 @@
- TCustomValidator not enabling ControlCssClass or prop:ClientSide.OnError after postback.
+ TCustomValidator not enabling ControlCssClass or prop:ClientSide.OnValidationError after postback.