diff options
Diffstat (limited to 'tests/FunctionalTests/tickets/protected/pages')
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page | 28 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php | 62 |
2 files changed, 90 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page new file mode 100644 index 00000000..cf7d2136 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page @@ -0,0 +1,28 @@ +<com:TContent ID="Content">
+
+<com:TActiveDropDownList ID="list1" AutoPostBack="true" OnSelectedIndexChanged="list1_changed">
+ <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:TActiveDropDownList>
+
+ <com:TActiveDropDownList ID="list2"
+ Enabled="false"
+ AutoPostBack="true" OnSelectedIndexChanged="list2_changed" />
+
+ <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 3" OnClick="select_index_3" />
+ <com:TActiveButton ID="button2" Text="Clear selection" OnClick="clear_selections" />
+ <com:TActiveButton ID="button3" Text="Select Value 'value 2'" OnClick="select_value_2" />
+ <com:TActiveButton ID="button4" Text="Select Item 3 And Sub Item 3" OnClick="select_index_3_plus" />
+
+ <com:TButton ID="button5" Text="Post Back" OnClick="do_postback"/>
+ </div>
+ <com:TActiveButton ID="button6" Text="Change list 2" OnClick="suggest"/>
+ <com:TAutoComplete ID="text1" OnSuggest="suggest" />
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php new file mode 100644 index 00000000..7d24e5f6 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php @@ -0,0 +1,62 @@ +<?php
+
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Ticket587_reopened extends TPage
+{
+ function list1_changed($sender)
+ {
+ $this->label1->setText("Selection 1: ".$sender->getSelectedValue());
+ $this->addOptionsToList2($sender->getSelectedValue(),$sender->getSelectedIndex());
+ }
+
+ function suggest($sender, $param)
+ {
+ $this->list2->Items->clear();
+ for($i = 0; $i < 2; $i++)
+ $this->list2->Items[$i] = 'asd 3 - item '.($i+1);
+ }
+
+ function addOptionsToList2($parent,$index)
+ {
+ $this->list2->Items->clear();
+ for($i = 0; $i < 2+$index; $i++)
+ $this->list2->Items[$i] = $parent.' - item '.($i+1);
+ $this->list2->setEnabled(true);
+ }
+
+ function list2_changed($sender)
+ {
+ $this->label1->setText("Selection 2: ".$sender->getSelectedValue());
+ }
+
+ function select_index_3()
+ {
+ $this->list1->setSelectedIndex(3);
+ }
+
+ function clear_selections()
+ {
+ $this->list1->clearSelection();
+ }
+
+ function select_value_2()
+ {
+ $this->list1->setSelectedValue("value 2");
+ }
+
+ function select_index_3_plus()
+ {
+ $this->list1->setSelectedValue("value 3");
+ $this->list1_changed($this->list1);
+ $this->list2->setSelectedValue("value 3 - item 3");
+ }
+
+ function do_postback()
+ {
+ $value = 'List 1: '.$this->list1->selectedValue. ', List 2: '. $this->list2->selectedValue;
+ $this->label1->Text = $value;
+ }
+}
+
+?>
\ No newline at end of file |