summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected
diff options
context:
space:
mode:
authorwei <>2006-08-12 05:34:54 +0000
committerwei <>2006-08-12 05:34:54 +0000
commit54d4919e3f1b00b644fa3c107acdf20159a1b154 (patch)
tree1c3e9cc679d4e08cc4beb06eee6f79838a34cb31 /tests/FunctionalTests/active-controls/protected
parent6dd529fdc25404da07cf9256d92f2a94985c65fc (diff)
Update active controls.
Diffstat (limited to 'tests/FunctionalTests/active-controls/protected')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page11
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.php16
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page27
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.php47
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page22
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.php27
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page38
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.php34
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page9
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php21
10 files changed, 247 insertions, 5 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page
new file mode 100644
index 00000000..cb9f0322
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page
@@ -0,0 +1,11 @@
+<com:TForm ID="form1">
+
+ <h1>TActiveLinkButton Functional Test</h1>
+ <com:TActiveLinkButton ID="button2" Text="Button 1"
+ OnClick="button2_onclick" OnCallback="button2_oncallback" />
+
+ <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/ActiveLinkButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.php
new file mode 100644
index 00000000..4fc3a23e
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.php
@@ -0,0 +1,16 @@
+<?php
+
+class ActiveLinkButtonTest extends TPage
+{
+ function button2_onclick($sender, $param)
+ {
+ $this->label1->Text = "Button 1 was clicked ";
+ }
+
+ function button2_oncallback($sender, $param)
+ {
+ $this->label1->Text .= "using callback!";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page
new file mode 100644
index 00000000..318d53c3
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.page
@@ -0,0 +1,27 @@
+<com:TForm ID="form1">
+
+ <h1>Active List Box Functional Test</h1>
+
+ <com:TActiveListBox ID="list1" OnCallback="list1_callback" SelectionMode="Multiple" style="width:20em;height:10em">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" />
+ <com:TListItem Value="value 5" Text="item 5" />
+ </com:TActiveListBox>
+
+ <div style="margin:1em; padding:1em; border:1px solid #ccc; text-align:center;">
+ <com:TActiveLabel ID="label1" Text="Label 1" />
+ </div>
+ <div style="margin:1em; padding:0.5em; text-align:center; border:1px solid #ccc;">
+ <com:TActiveButton ID="button1" Text="Select Index 1 2 3" OnClick="select_index_123" />
+ <com:TActiveButton ID="button2" Text="Clear selection" OnClick="clear_selections" />
+ <com:TActiveButton ID="button3" Text="Select Value 'value 1'" OnClick="select_value_1" />
+ <com:TActiveButton ID="button4" Text="Select Index 4" OnClick="select_index_4" />
+ <com:TActiveButton ID="button5" Text="Select Values 'value 2', 'value 5'" OnClick="select_values_25" />
+ <com:TActiveButton ID="button6" Text="Change to Multi-Select" OnClick="change_to_multiple" />
+ <com:TActiveButton ID="button7" Text="Change to Single-Select" OnClick="change_to_single" />
+ </div>
+
+ <com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.php
new file mode 100644
index 00000000..942bb1a0
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveListBoxTest.php
@@ -0,0 +1,47 @@
+<?php
+
+class ActiveListBoxTest extends TPage
+{
+ function list1_callback($sender, $param)
+ {
+ $values = $sender->getSelectedValues();
+ $this->label1->setText("Selection: ".implode(', ', $values));
+ }
+
+ function select_index_123()
+ {
+ $this->list1->setSelectedIndices(array(1,2,3));
+ }
+
+ function select_index_4()
+ {
+ $this->list1->setSelectedIndex(4);
+ }
+
+ function clear_selections()
+ {
+ $this->list1->clearSelection();
+ }
+
+ function select_value_1()
+ {
+ $this->list1->setSelectedValue("value 1");
+ }
+
+ function select_values_25()
+ {
+ $this->list1->setSelectedValues(array('value 2', 'value 5'));
+ }
+
+ function change_to_multiple()
+ {
+ $this->list1->SelectionMode="Multiple";
+ }
+
+ function change_to_single()
+ {
+ $this->list1->SelectionMode="Single";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page
new file mode 100644
index 00000000..26feb594
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.page
@@ -0,0 +1,22 @@
+<com:TForm ID="form1">
+ <h1>TActiveRadioButtonList Test Case</h1>
+
+ <com:TActiveRadioButtonList ID="list1" OnCallback="list1_callback">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" />
+ <com:TListItem Value="value 5" Text="item 5" />
+ </com:TActiveRadioButtonList>
+ <div style="margin:1em; padding:1em; border:1px solid #ccc; text-align:center;">
+ <com:TActiveLabel ID="label1" Text="Label 1" />
+ </div>
+ <div style="margin:1em; padding:0.5em; text-align:center; border:1px solid #ccc;">
+ <com:TActiveButton ID="button2" Text="Clear selection" OnClick="clear_selections" />
+ <com:TActiveButton ID="button3" Text="Select Value 'value 1'" OnClick="select_value_1" />
+ <com:TActiveButton ID="button4" Text="Select Index 4" OnClick="select_index_4" />
+ </div>
+
+ <com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.php
new file mode 100644
index 00000000..930d671b
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.php
@@ -0,0 +1,27 @@
+<?php
+
+class ActiveRadioButtonListTest extends TPage
+{
+ function list1_callback($sender, $param)
+ {
+ $values = $sender->getSelectedValues();
+ $this->label1->setText("Selection: ".implode(', ', $values));
+ }
+
+ function select_index_4()
+ {
+ $this->list1->setSelectedIndex(4);
+ }
+
+ function clear_selections()
+ {
+ $this->list1->clearSelection();
+ }
+
+ function select_value_1()
+ {
+ $this->list1->setSelectedValue("value 1");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
new file mode 100644
index 00000000..c5c40c44
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
@@ -0,0 +1,38 @@
+<com:TForm ID="form1">
+ <h1>Active Radio Button Test</h1>
+ <com:TActiveRadioButton ID="radio1"
+ GroupName="group1" Text="Radio Button 1"
+ OnCallback="radiobutton_requested"/>
+ <com:TActiveRadioButton ID="radio2"
+ GroupName="group1" Text="Radio Button 2"
+ OnCallback="radiobutton_requested">
+ <prop:ActiveControl.ClientSide OnLoading="$('status').show()" OnComplete="$('status').hide()" />
+ </com:TActiveRadioButton>
+ <com:TActiveRadioButton ID="radio3"
+ Text="Radio Button 3"
+ OnCallback="radiobutton_requested" />
+ <div style="margin:1em; padding:0.5em; text-align:center; border:1px solid #ccc;">
+ <com:TActiveLabel ID="label1" Text="Label 1" />
+ </div>
+ <div style="margin:1em; padding: 1em; text-align: center">
+ <com:TActiveButton id="change_text1"
+ OnClick="change_radio1_text" Text="Change Radio Button 1 Text"/>
+ <com:TActiveButton id="change_radio1"
+ OnClick="change_radio1_checked" Text="Check Radio Button 1"/>
+
+ <com:TActiveButton id="change_text2"
+ OnClick="change_radio2_text" Text="Change Radio Button 2 Text"/>
+ <com:TActiveButton id="change_radio2"
+ OnClick="change_radio2_checked" Text="Check Radio Button 2"/>
+
+ </div>
+
+ <div id="status" style="margin:1em; padding:0.5em;
+ text-align:center;
+ background-color:#900;
+ color:white; display: none;
+ position: absolute; right: 0; top: 0">
+ Loading...
+ </div>
+ <com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.php
new file mode 100644
index 00000000..64e7d92e
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.php
@@ -0,0 +1,34 @@
+<?php
+
+class ActiveRadioButtonTest extends TPage
+{
+ function change_radio1_text()
+ {
+ $this->radio1->Text = "Hello Radio Button 1";
+ }
+
+ function change_radio1_checked()
+ {
+ $this->radio1->Checked = !$this->radio1->Checked;
+ }
+
+ function change_radio2_text()
+ {
+ $this->radio2->Text = "Radio Button 2 World";
+ }
+
+ function change_radio2_checked()
+ {
+ $this->radio2->Checked = !$this->radio2->Checked;
+ }
+
+ function radiobutton_requested($sender, $param)
+ {
+ $this->label1->Text = "Label 1:".$sender->Text.
+ ($sender->checked ? ' Checked ' : ' Not Checked');
+ }
+
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
index b0c22587..7842cde9 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page
@@ -9,7 +9,16 @@ Main Panel
</com:TPanel>
</com:TPanel>
+<com:TPanel ID="newPanel" Visible="false">
+ Time : <com:TButton Text=<%= time() %> />
+</com:TPanel>
+
+<div>
<com:TTextBox ID="content" />
+<br />
+<com:TCheckBox ID="check1" Text="Replace using Controls" />
+</div>
+
<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"/>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php
index 0e09a012..a5358d98 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php
@@ -4,27 +4,38 @@ class ReplaceContentTest extends TPage
{
function appendContent($sender, $param)
{
- $this->CallbackClient->appendContent($this->subpanel, $this->content->Text);
+ $this->CallbackClient->appendContent($this->subpanel, $this->replacementContent());
}
function prependContent($sender, $param)
{
- $this->CallbackClient->prependContent($this->subpanel, $this->content->Text);
+ $this->CallbackClient->prependContent($this->subpanel, $this->replacementContent());
}
function insertContentBefore($sender, $param)
{
- $this->CallbackClient->insertContentBefore($this->subpanel, $this->content->Text);
+ $this->CallbackClient->insertContentBefore($this->subpanel, $this->replacementContent());
}
function insertContentAfter($sender, $param)
{
- $this->CallbackClient->insertContentAfter($this->subpanel, $this->content->Text);
+ $this->CallbackClient->insertContentAfter($this->subpanel, $this->replacementContent());
}
function replaceContent($sender, $param)
{
- $this->CallbackClient->replaceContent($this->subpanel, $this->content->Text);
+ $this->CallbackClient->replaceContent($this->subpanel, $this->replacementContent());
+ }
+
+ function replacementContent()
+ {
+ if($this->check1->Checked)
+ {
+ $this->newPanel->Visible=true;
+ return $this->newPanel;
+ }
+ else
+ return $this->content->Text;
}
}