summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-05-31 01:47:08 +0000
committerxue <>2006-05-31 01:47:08 +0000
commit652bffab24bab354d9e3022b22866640f4fd4a0e (patch)
tree4af511b9928387713f68a3ab279e7e3dc2980021
parentbf900e824f2c661df6380fd0360c13377da58bae (diff)
Fixed a bug that newly created controls during postbacks may get their initial states reset during loadStateRecursive.
-rw-r--r--HISTORY1
-rw-r--r--demos/blog/protected/Pages/ErrorReport.page2
-rw-r--r--demos/blog/protected/Pages/Posts/ListPost.php1
-rw-r--r--demos/blog/protected/Pages/SearchPost.page2
-rw-r--r--framework/Web/UI/TControl.php11
-rw-r--r--tests/FunctionalTests/validators/tests/RequiredListTestCase.php26
6 files changed, 20 insertions, 23 deletions
diff --git a/HISTORY b/HISTORY
index 1eec7319..97bc0800 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9,6 +9,7 @@ BUG: Ticket#169 - Validation of subclass of THtmlArea/TDatePicker fails (Wei)
BUG: Ticket#179 - CGI incompatibility causing clientscripts.php failure (Qiang)
BUG: Ticket#181 - Unable to change Content-Type in response header if charset is not set (Qiang)
BUG: Ticket#200 - onClick javascript event triggered twice on CheckBox label (Qiang)
+BUG: newly created controls during postbacks might get their initial states reset during loadStateRecursive. (Qiang)
ENH: Ticket#150 - TDataGrid and TDataList now render table section tags (Qiang)
ENH: Ticket#152 - constituent parts of TWizard are exposed (Qiang)
ENH: Ticket#184 - added TUserManager.Users and Roles properties (Qiang)
diff --git a/demos/blog/protected/Pages/ErrorReport.page b/demos/blog/protected/Pages/ErrorReport.page
index 3a068e3c..90c659e8 100644
--- a/demos/blog/protected/Pages/ErrorReport.page
+++ b/demos/blog/protected/Pages/ErrorReport.page
@@ -1,3 +1,5 @@
+<%@ Title="Error" %>
+
<com:TContent ID="Main">
<h2>Error</h2>
diff --git a/demos/blog/protected/Pages/Posts/ListPost.php b/demos/blog/protected/Pages/Posts/ListPost.php
index 8c51546f..c3b2bcc9 100644
--- a/demos/blog/protected/Pages/Posts/ListPost.php
+++ b/demos/blog/protected/Pages/Posts/ListPost.php
@@ -36,6 +36,7 @@ class ListPost extends BlogPage
$this->_category=$this->DataAccess->queryCategoryByID($catID);
$this->CategoryPanel->Visible=true;
}
+ $this->Title=$this->Application->Parameters['SiteTitle'];
}
private function getPageOffset()
diff --git a/demos/blog/protected/Pages/SearchPost.page b/demos/blog/protected/Pages/SearchPost.page
index e3a71d44..6a4b2e04 100644
--- a/demos/blog/protected/Pages/SearchPost.page
+++ b/demos/blog/protected/Pages/SearchPost.page
@@ -1,3 +1,5 @@
+<%@ Title="Search Results" %>
+
<com:TContent ID="Main">
<div class="search-title">
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 66ac8fd5..36cc34dd 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -1522,11 +1522,6 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
$control->loadStateRecursive($state[$control->_id],$needViewState);
unset($state[$control->_id]);
}
- else
- {
- $s=array();
- $control->loadStateRecursive($s,$needViewState);
- }
}
}
}
@@ -1560,11 +1555,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
foreach($this->_rf[self::RF_CONTROLS] as $control)
{
if($control instanceof TControl)
- {
- $cs=&$control->saveStateRecursive($needViewState);
- if(!empty($cs))
- $state[$control->_id]=&$cs;
- }
+ $state[$control->_id]=&$control->saveStateRecursive($needViewState);
}
}
if($needViewState && !empty($this->_viewState))
diff --git a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
index ad299dc5..cb10f201 100644
--- a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
+++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
@@ -1,8 +1,8 @@
<?php
-class RequiredListTestCase extends SeleniumTestCase
+class RequiredListTestCase extends SeleniumTestCase
{
-
+
function test()
{
$base = "ctl0_Content_";
@@ -12,28 +12,28 @@ class RequiredListTestCase extends SeleniumTestCase
$this->assertVisible("{$base}validator1");
$this->assertVisible("{$base}validator2");
$this->assertVisible("{$base}validator3");
- $this->click("{$base}list1_0");
+ $this->click("{$base}list1_c0");
$this->select("{$base}list2", "label=One");
$this->select("{$base}list2", "label=Two");
- $this->click("{$base}list3_3");
+ $this->click("{$base}list3_c3");
$this->clickAndWait("{$base}submit1");
$this->assertNotVisible("{$base}validator1");
$this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list1_1");
- $this->click("{$base}list1_2");
- $this->click("{$base}list1_3");
+ $this->click("{$base}list1_c1");
+ $this->click("{$base}list1_c2");
+ $this->click("{$base}list1_c3");
$this->select("{$base}list2", "label=Two");
- $this->click("{$base}list1_3");
- $this->click("{$base}submit1");
+ $this->click("{$base}list1_c3");
+ $this->click("{$base}submit1");
$this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list3_3");
- $this->click("{$base}submit1");
+ $this->click("{$base}list3_c3");
+ $this->click("{$base}submit1");
$this->pause(200);
$this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator2");
$this->assertNotVisible("{$base}validator3");
}
}