From b687748278d29510bb28875627c98b5da0a96cc5 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Fri, 11 Aug 2006 05:05:32 +0000
Subject: Fixed callback replace content.
---
.../protected/pages/ActivePanelTest.php | 2 +-
.../protected/pages/CustomTemplateComponent.php | 11 ++++++++
.../protected/pages/CustomTemplateComponent.tpl | 6 +++++
.../protected/pages/CustomTemplateControlTest.page | 16 +++++++++++
.../protected/pages/CustomTemplateControlTest.php | 27 +++++++++++++++++++
.../protected/pages/NestedActiveControls.php | 4 +--
.../protected/pages/ReplaceContentTest.page | 22 +++++++++++++++
.../protected/pages/ReplaceContentTest.php | 31 ++++++++++++++++++++++
.../protected/pages/TextBoxValidationCallback.page | 21 +++++++++++++++
.../protected/pages/TextBoxValidationCallback.php | 11 ++++++++
10 files changed, 148 insertions(+), 3 deletions(-)
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.php
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/CustomTemplateComponent.tpl
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.page
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.page
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/TextBoxValidationCallback.php
(limited to 'tests/FunctionalTests/active-controls/protected')
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 @@
+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 @@
+
+ Getting textbox from the template!!!
+ Client ID: <%# $this->ThePanel->getClientID() %>
+
+
+
\ 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 @@
+
+
+ Add Dynamic Custom TTemplateControl Test
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
+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 @@
+
+
+Callback Replace Content Test
+
+
+Main Panel
+
+ Sub Panel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
+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 @@
+
+TextBox AutoPostBack With Group Validation
+
+
+
+
+
+
+
+
+
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 @@
+City->Text = "City: ".$this->Address->Text . ' Zip: '.$this->ZipCode->Text;
+ }
+}
+?>
\ No newline at end of file
--
cgit v1.2.3