summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/protected/pages
diff options
context:
space:
mode:
authortof <>2007-09-26 12:57:46 +0000
committertof <>2007-09-26 12:57:46 +0000
commit75293bddc7faea69021f5e29ac9e4df3f04c4f36 (patch)
tree1e7fdf2324844c45fb1fa96a99ed69142f4c1aa2 /tests/FunctionalTests/tickets/protected/pages
parentf39661c02e0686848c01017fc51f1cd2ad714909 (diff)
Add test for ticket #671
Diffstat (limited to 'tests/FunctionalTests/tickets/protected/pages')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket671.page34
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket671.php33
2 files changed, 67 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket671.page b/tests/FunctionalTests/tickets/protected/pages/Ticket671.page
new file mode 100644
index 00000000..22c899f5
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket671.page
@@ -0,0 +1,34 @@
+<com:TContent ID="Content">
+
+<com:TActiveDropDownList id="addl" OnSelectedIndexChanged="SelectItem" ValidationGroup="Test1">
+ <com:TListItem Value="1" Text="Test 1"/>
+ <com:TListItem Value="2" Text="Test 2"/>
+ <com:TListItem Value="3" Text="Test 3"/>
+</com:TActiveDropDownList>
+<com:TActiveCustomValidator
+ ControlToValidate="addl"
+ ValidationGroup="Test1"
+ OnServerValidate="validateSelection"
+ Display="Dynamic"
+ ErrorMessage="Please Select Test 3"/>
+<com:TActiveLinkButton
+ Text="Submit"
+ OnClick="submit"
+ ValidationGroup="Test1" />
+<com:TActiveLabel id="lblResult"/>
+<br/><br/>
+<com:TActiveTextBox ID="testTextBox" ValidationGroup="Test2" />
+<com:TActiveCustomValidator
+ ControlToValidate="testTextBox"
+ ValidationGroup="Test2"
+ OnServerValidate="validateTextBox"
+ ErrorMessage="Please enter 'Prado' !"
+ Display="Dynamic"
+ />
+<com:TActiveLinkButton
+ Text="Validate"
+ ValidationGroup="Test2"
+ OnClick="submit2" />
+<com:TActiveLabel id="lblResult2"/>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket671.php b/tests/FunctionalTests/tickets/protected/pages/Ticket671.php
new file mode 100644
index 00000000..04bd1a7e
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket671.php
@@ -0,0 +1,33 @@
+<?php
+
+prado::using ('System.Web.UI.ActiveControls.*');
+
+class Ticket671 extends TPage
+{
+ public function validateSelection($sender, $param)
+ {
+ $param->setIsValid($param->getValue()==3);
+ }
+
+ public function selectItem ($sender, $param)
+ {
+ $this->lblResult->text="You have selected '".$sender->getSelectedItem()->getText()."'.";
+ if (!$this->getIsValid()) $this->lblResult->text .= " But this is not valid !";
+ }
+
+ public function submit ($sender, $param)
+ {
+ $this->lblResult->text="You have successfully validated the form";
+ }
+
+ public function validateTextBox($sender,$param) {
+ $param->setIsValid(strtolower($param->getValue())=="prado");
+ }
+
+ public function submit2($sender,$param) {
+ $this->lblResult2->text="Thanks !";
+ }
+
+
+}
+?> \ No newline at end of file