diff options
author | wei <> | 2006-12-13 10:07:37 +0000 |
---|---|---|
committer | wei <> | 2006-12-13 10:07:37 +0000 |
commit | 3c24d31c69dffb6f65214b6d383d446ac122ff14 (patch) | |
tree | 971267876c36893930f84d9663031b154799b10b /tests/FunctionalTests/active-controls/protected | |
parent | 840854be7886236d46d3408de5a084983373b4c7 (diff) |
Fixed #488.
Diffstat (limited to 'tests/FunctionalTests/active-controls/protected')
6 files changed, 174 insertions, 0 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page new file mode 100644 index 00000000..5cacf2ef --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page @@ -0,0 +1,37 @@ +<com:TForm>
+
+<h1>Custom Login</h1>
+
+<com:TActiveLinkButton ID="showLogin" Attributes.OnClick="new Effect.Appear('loginBox')" Text="Login" />
+<div id="loginBox" style="display: none;">
+
+ <div id="loginLoader" style="display: none;">Please Wait...</div>
+
+ <span>Username:</span><br />
+ <com:TActiveTextBox ID="Username" />
+ <com:TRequiredFieldValidator
+ ID="validator1"
+ ControlToValidate="Username"
+ ValidationGroup="login"
+ Text="...is required" Display="Dynamic"/>
+
+ <br />
+
+ <span>Password:</span><br />
+ <com:TActiveTextBox TextMode="Password" ID="Password" />
+ <com:TActiveCustomValidator
+ ID="validator2"
+ ControlToValidate="Password"
+ Text="*"
+ OnServerValidate="validateUser" ValidationGroup="login" />
+
+ <br />
+
+ <com:TActiveLinkButton ID="checkLogin" OnCallback="doLogin" Text="Login" ValidationGroup="login" />
+ <com:TActiveLinkButton Attributes.OnClick="new Effect.Fade('loginBox')" Text="Close" />
+
+</div>
+
+<com:TJavascriptLogger />
+
+</com:TForm>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.php b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.php new file mode 100644 index 00000000..e88f10de --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.php @@ -0,0 +1,37 @@ +<?php
+
+class CustomValidatorByPass extends TPage
+{
+ public function onLoad($param)
+ {
+
+ parent::onLoad($param);
+
+ $Client = $this->validator2->getActiveControl()->getClientSide();
+
+ $Client->setOnLoading('$(\'loginLoader\').show();');
+ $Client->setOnComplete('$(\'loginLoader\').hide();');
+
+ //$Client->setOnValidationError('alert(\'Authentication Failed\');');
+ $Client->setOnValidationSuccess('new Effect.Fade(\'loginBox\')');
+
+ }
+
+ public function validateUser($sender,$param)
+ {
+ $param->IsValid = $this->Password->Text=='test';
+ }
+
+ public function doLogin($sender,$param)
+ {
+
+ /* This isnt even getting called */
+ if($this->Page->IsValid)
+ {
+ // Re-Render the active panel
+ }
+
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyControl.php b/tests/FunctionalTests/active-controls/protected/pages/MyControl.php new file mode 100644 index 00000000..2c6b7f5b --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/MyControl.php @@ -0,0 +1,8 @@ +<?php
+
+class MyControl extends TTemplateControl
+{
+
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyControl.tpl b/tests/FunctionalTests/active-controls/protected/pages/MyControl.tpl new file mode 100644 index 00000000..5cc17772 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/MyControl.tpl @@ -0,0 +1,9 @@ +<div id="mycontrol">
+ <com:TActivePanel ID="pnlHeader" ActiveControl.EnableUpdate="false">
+ <h2><com:TLabel ID="Heading" Text="Title"/></h2>
+ </com:TActivePanel>
+ <com:TActivePanel ID="pnlContents" ActiveControl.EnableUpdate="false">
+ This is just some text.<br/>
+ This is just some text.<br/>
+ </com:TActivePanel>
+</div>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page new file mode 100644 index 00000000..7371086a --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.page @@ -0,0 +1,41 @@ +<com:TForm ID="form1">
+
+<h1>My Tab Panel Test</h1>
+
+<div id="loading" style="display: none; z-index: 10; width: 16px; height: 16px; position: absolute; left: 5px; top: 5px;">
+ LLoading...
+</div>
+<ul>
+<li>
+ <com:TActiveLinkButton OnCallback="onShowPanelA" Text="Panel A">
+ <prop:ClientSide OnLoading="$('loading').show()" OnComplete="$('loading').hide()"/>
+ </com:TActiveLinkButton>
+</li>
+<li>
+ <com:TActiveLinkButton OnCallback="onShowPanelB" Text="Panel B">
+ <prop:ClientSide OnLoading="$('loading').show()" OnComplete="$('loading').hide()"/>
+ </com:TActiveLinkButton>
+</li>
+<li>
+ <com:TActiveLinkButton OnCallback="onShowPanelC" Text="Panel C">
+ <prop:ClientSide OnLoading="$('loading').show()" OnComplete="$('loading').hide()"/>
+ </com:TActiveLinkButton>
+</li>
+</ul>
+
+<com:TActivePanel ID="pnlContentsA" Attributes.style="display: none;">
+ This is the contents of panel A
+ <com:Application.pages.MyControl/>
+</com:TActivePanel>
+
+<com:TActivePanel ID="pnlContentsB" Attributes.style="display: none;">
+ This is the contents of panel B
+</com:TActivePanel>
+
+<com:TActivePanel ID="pnlContentsC" Attributes.style="display: none;">
+ This is the contents of panel C
+</com:TActivePanel>
+
+<com:TJavascriptLogger />
+
+</com:TForm>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.php b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.php new file mode 100644 index 00000000..723af42d --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/MyTabPanelTest.php @@ -0,0 +1,42 @@ +<?php
+
+class MyTabPanelTest extends TPage
+{
+ private $panels = array('pnlContentsA', 'pnlContentsB', 'pnlContentsC', );
+
+ private function showPanel($id, $param)
+ {
+ foreach($this->panels as $panel)
+ {
+ if($id == $panel)
+ {
+ $this->$panel->setAttribute('style', 'display: block;');
+ $this->$panel->setVisible(true);
+ $this->$panel->render($param->NewWriter);
+ }
+ else
+ {
+ $this->$panel->setVisible(false);
+ }
+ }
+ }
+
+ public function onShowPanelA($sender, $param)
+ {
+ $this->showPanel('pnlContentsA', $param);
+ }
+
+ public function onShowPanelB($sender, $param)
+ {
+ $this->showPanel('pnlContentsB', $param);
+ }
+
+ public function onShowPanelC($sender, $param)
+ {
+ $this->showPanel('pnlContentsC', $param);
+ }
+}
+
+
+
+?>
\ No newline at end of file |