diff options
author | wei <> | 2007-05-08 03:02:03 +0000 |
---|---|---|
committer | wei <> | 2007-05-08 03:02:03 +0000 |
commit | 0ee23d595c73a94fd61e486cce2f6f42b4c19fdf (patch) | |
tree | 7479a355344263f3343fff6d0804eed6fbf8f5e6 | |
parent | 33737a9270c27478da9f4d50d0fd2bb26ceb6991 (diff) |
Fixed #587
5 files changed, 121 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes index e36a617b..bd7b1341 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2565,6 +2565,8 @@ tests/FunctionalTests/tickets/protected/pages/Ticket586.page -text tests/FunctionalTests/tickets/protected/pages/Ticket586.php -text tests/FunctionalTests/tickets/protected/pages/Ticket587.page -text tests/FunctionalTests/tickets/protected/pages/Ticket587.php -text +tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php -text tests/FunctionalTests/tickets/protected/pages/Ticket605.page -text tests/FunctionalTests/tickets/protected/pages/Ticket606.page -text tests/FunctionalTests/tickets/protected/pages/Ticket614.page -text @@ -2606,6 +2608,7 @@ tests/FunctionalTests/tickets/tests/Ticket573TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket578TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket585TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket586TestCase.php -text +tests/FunctionalTests/tickets/tests/Ticket587TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket72TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket93TestCase.php -text tests/FunctionalTests/validators.php -text diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php index aaa14920..3b457bbb 100644 --- a/framework/Web/UI/ActiveControls/TAutoComplete.php +++ b/framework/Web/UI/ActiveControls/TAutoComplete.php @@ -321,7 +321,8 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer */
protected function getPostBackOptions()
{
- $this->getActiveControl()->getClientSide()->setEnablePageStateUpdate(false);
+ //disallow page state update ?
+ //$this->getActiveControl()->getClientSide()->setEnablePageStateUpdate(false);
$options = array();
if(strlen($string = $this->getSeparator()))
{
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 diff --git a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php new file mode 100644 index 00000000..f02b6a42 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php @@ -0,0 +1,26 @@ +<?php
+
+class Ticket587TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = 'ctl0_Content_';
+ $this->open('tickets/index.php?page=Ticket587_reopened');
+ $this->assertTitle("Verifying Ticket 587_reopened");
+
+ $this->assertText($base."label1", "Label 1");
+ $this->select($base."list1", "item 3");
+ $this->pause(800);
+ $this->select($base."list2", "value 3 - item 4");
+ $this->pause(800);
+ $this->assertText($base."label1", "Selection 2: value 3 - item 4");
+
+ $this->keyPress($base.'text1', 't');
+ $this->pause(800);
+ $this->select($base."list2", "asd 3 - item 2");
+ $this->pause(800);
+ $this->assertText($base."label1", "Selection 2: asd 3 - item 2");
+ }
+}
+
+?>
\ No newline at end of file |