summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected
diff options
context:
space:
mode:
authorwei <>2006-08-11 05:05:32 +0000
committerwei <>2006-08-11 05:05:32 +0000
commitb687748278d29510bb28875627c98b5da0a96cc5 (patch)
tree6d4f4b89027129530eae6d6aaf9c96c18b5ad8e2 /tests/FunctionalTests/active-controls/protected
parentdeb09283421970296b7ec6931d9eab3529be44ed (diff)
Fixed callback replace content.
Diffstat (limited to 'tests/FunctionalTests/active-controls/protected')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.php11
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.tpl6
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page16
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php27
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php4
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page22
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php31
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page21
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.php11
10 files changed, 148 insertions, 3 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php
index 79e3d46c..8a0a4316 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php
@@ -5,7 +5,7 @@ class ActivePanelTest extends TPage
function callback1_requested($sender, $param)
{
$this->content1->visible = true;
- $this->panel1->flush($param->output);
+ $this->panel1->render($param->output);
}
}
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.php b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.php
new file mode 100644
index 00000000..7da2834e
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.php
@@ -0,0 +1,11 @@
+<?php
+
+class CustomTemplateComponent extends TTemplateControl
+{
+ public function suboncallback ($sender, $param)
+ {
+ $sender->setText("Foo");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.tpl b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.tpl
new file mode 100644
index 00000000..04a0476a
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.tpl
@@ -0,0 +1,6 @@
+<com:TPanel ID="ThePanel" GroupingText="Foolio">
+ Getting textbox from the template!!!<br />
+ Client ID: <%# $this->ThePanel->getClientID() %>
+ <div><com:TTextBox ID="foo" /></div>
+ <com:TButton ID="lalalala" Text="Llalalaal" OnClick="suboncallback" />
+</com:TPanel> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page
new file mode 100644
index 00000000..3bed7d5b
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page
@@ -0,0 +1,16 @@
+<com:TForm ID="form1">
+
+ <h1>Add Dynamic Custom TTemplateControl Test</h1>
+ <com:TActivePanel ID="Foo">
+ <com:TTextBox ID="foo" />
+ </com:TActivePanel>
+ <com:TActiveButton ID="button2" Text="Button 1"
+ OnClick="button2_onclick" OnCallback="button2_callback"/>
+
+ <com:TActivePanel ID="placeholder" />
+
+ <com:TActiveLabel ID="label1" Text="Label 1" />
+
+
+ <com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php
new file mode 100644
index 00000000..753de25c
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php
@@ -0,0 +1,27 @@
+<?php
+
+class CustomTemplateControlTest extends TPage
+{
+ function button2_onclick($sender, $param)
+ {
+
+ $this->label1->Text = "Button 1 was clicked ";
+ $this->label1->Text .= $this->foo->Text;
+
+ $x=Prado::createComponent('Application.pages.CustomTemplateComponent');
+
+ $this->placeholder->getControls()->add($x);
+ $this->placeholder->dataBind();
+ }
+
+ function button2_callback($sender, $param)
+ {
+ $this->placeholder->render($param->output);
+
+ $this->label1->Text .= " using callback!";
+ $this->label1->Text .= "... and this is the textbox text: ". $this->foo->Text;
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php
index a4a22cbf..4c6190ee 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php
@@ -5,9 +5,9 @@ class NestedActiveControls extends TPage
function callback1_requested($sender, $param)
{
$this->content1->visible = true;
- $this->panel1->flush($param->output);
+ $this->panel1->render($param->output);
}
-
+
function button1_clicked($sender, $param)
{
$this->label1->Text = "Label 1: Button 1 Clicked";
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
new file mode 100644
index 00000000..b0c22587
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
@@ -0,0 +1,22 @@
+<com:TForm>
+
+<h1>Callback Replace Content Test</h1>
+
+<com:TPanel ID="panel1" style="border:1px solid red; background-color: #ffc; padding:2em;">
+Main Panel
+ <com:TPanel ID="subpanel" style="border:1px solid blue; background-color: #fff; padding: 2em;">
+ Sub Panel
+ </com:TPanel>
+</com:TPanel>
+
+<com:TTextBox ID="content" />
+<com:TActiveButton id="btn_append" Text="Append to Sub Panel" OnCallback="appendContent"/>
+<com:TActiveButton id="btn_prepend" Text="Prepend to Sub Panel" OnCallback="prependContent" />
+<com:TActiveButton id="btn_before" Text="Insert Before Sub Panel" OnCallback="insertContentBefore"/>
+<com:TActiveButton id="btn_after" Text="Insert After Sub Panel" OnCallback="insertContentAfter"/>
+
+<com:TActiveButton id="btn_replace" Text="Replace" OnCallback="replaceContent"/>
+
+<com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php
new file mode 100644
index 00000000..0e09a012
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php
@@ -0,0 +1,31 @@
+<?php
+
+class ReplaceContentTest extends TPage
+{
+ function appendContent($sender, $param)
+ {
+ $this->CallbackClient->appendContent($this->subpanel, $this->content->Text);
+ }
+
+ function prependContent($sender, $param)
+ {
+ $this->CallbackClient->prependContent($this->subpanel, $this->content->Text);
+ }
+
+ function insertContentBefore($sender, $param)
+ {
+ $this->CallbackClient->insertContentBefore($this->subpanel, $this->content->Text);
+ }
+
+ function insertContentAfter($sender, $param)
+ {
+ $this->CallbackClient->insertContentAfter($this->subpanel, $this->content->Text);
+ }
+
+ function replaceContent($sender, $param)
+ {
+ $this->CallbackClient->replaceContent($this->subpanel, $this->content->Text);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page
new file mode 100644
index 00000000..79fc17e0
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page
@@ -0,0 +1,21 @@
+<com:TForm>
+<h1>TextBox AutoPostBack With Group Validation</h1>
+<com:TTextBox ID="Address" Columns="60" Maxlength="128" />
+<com:TRequiredFieldValidator
+ ID="validator1"
+ ControlToValidate="Address"
+ ValidationGroup="post"
+ ErrorMessage="*" />
+
+<com:TActiveTextBox
+ AutoPostBack="true"
+ ID="ZipCode"
+ Columns="4"
+ Maxlength="12"
+ ValidationGroup="post"
+ OnCallback="lookupZipCode"/>
+<com:TJavascriptLogger />
+
+<com:TActiveTextBox ID="City" Columns="60" Maxlength="128" />
+
+</com:TForm>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.php b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.php
new file mode 100644
index 00000000..cf43bccd
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.php
@@ -0,0 +1,11 @@
+<?php
+
+class TextBoxValidationCallback extends TPage
+{
+
+ function lookupZipCode()
+ {
+ $this->City->Text = "City: ".$this->Address->Text . ' Zip: '.$this->ZipCode->Text;
+ }
+}
+?> \ No newline at end of file