summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe.Boulain <>2010-01-11 12:48:47 +0000
committerChristophe.Boulain <>2010-01-11 12:48:47 +0000
commitd93af5633b1459cb670904b16c914e7313bbc576 (patch)
tree06d912ee6db123b968d3e2347886e2417e676326
parent3b9672007e822483653deaf8f1c117d6ecc58309 (diff)
Fixed Issue#216
-rw-r--r--.gitattributes3
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TTabPanel.php1
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Issue216.page15
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Issue216.php14
-rw-r--r--tests/FunctionalTests/tickets/tests/Issue216TestCase.php28
6 files changed, 62 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index e8b3efd0..772a2b7d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2965,6 +2965,8 @@ tests/FunctionalTests/tickets/protected/messages/en/messages.xml -text
tests/FunctionalTests/tickets/protected/pages/DActiveDropDownList2.php -text
tests/FunctionalTests/tickets/protected/pages/Issue120.page -text
tests/FunctionalTests/tickets/protected/pages/Issue120.php -text
+tests/FunctionalTests/tickets/protected/pages/Issue216.page -text
+tests/FunctionalTests/tickets/protected/pages/Issue216.php -text
tests/FunctionalTests/tickets/protected/pages/Layout.php -text
tests/FunctionalTests/tickets/protected/pages/Layout.tpl -text
tests/FunctionalTests/tickets/protected/pages/TestHtmlArea.php -text
@@ -3139,6 +3141,7 @@ tests/FunctionalTests/tickets/protected700/pages/admin/users/config.xml -text
tests/FunctionalTests/tickets/protected700/pages/config.xml -text
tests/FunctionalTests/tickets/protected700/pages/content/Home.page -text
tests/FunctionalTests/tickets/tests/Issue120TestCase.php -text
+tests/FunctionalTests/tickets/tests/Issue216TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket121TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket163TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket169TestCase.php -text
diff --git a/HISTORY b/HISTORY
index affda9c7..8c9f71a5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -8,6 +8,7 @@ BUG: Issue#188 - TDbCache doesn't check if db connection is active. (Yves)
BUG: Issue#189 - Page State corrupted when EnableStateValidation=False (Christophe)
BUG: Issue#191 - Bad parsing of MySQL ENUM type column (Yves)
BUG: Issue#198 - "Undefined variable: tagName" after error in application configuration. (Christophe)
+BUG: Issue#216 - TTabPanel doesn't preserve active tab on callback request (googlenew at pcforum.hu,Christophe)
BUG: Typo in TBoundColumn (Robin)
ENH: Add property ClientScriptManagerClass to TPageService and releated changes in TPage.getClientScript() (Yves)
ENH: Always render clientside counterparts of validation control even if not enabled, but pass-through Enabled property, to allow Enabled/Disable of validator on callback. (Yves)
diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php
index 961d0797..5deced79 100644
--- a/framework/Web/UI/WebControls/TTabPanel.php
+++ b/framework/Web/UI/WebControls/TTabPanel.php
@@ -413,6 +413,7 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
$cs->registerEndScript("prado:$id", $code);
$cs->registerHiddenField($id.'_1',$this->getActiveViewIndex());
$page->registerRequiresPostData($this);
+ $page->registerRequiresPostData($id."_1");
}
/**
diff --git a/tests/FunctionalTests/tickets/protected/pages/Issue216.page b/tests/FunctionalTests/tickets/protected/pages/Issue216.page
new file mode 100644
index 00000000..2efff728
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Issue216.page
@@ -0,0 +1,15 @@
+<com:TContent ID="Content">
+ <h1>TTabPanel doesn't preserve active tab on callback request</h1>
+
+ <com:TTabPanel id="tabpanel">
+ <com:TTabView id="tab1" Caption="Tab 1">
+ <p>This is Tab 1</p>
+ </com:TTabView>
+ <com:TTabView id="tab2" Caption="Tab 2">
+ <p>This is Tab 2</p>
+ </com:TTabView>
+ </com:TTabPanel>
+
+ <com:TActiveButton id="btn1" OnCallback="buttonClickCallback" Text ="Click me"/>
+ <com:TActiveLabel id="result"/>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Issue216.php b/tests/FunctionalTests/tickets/protected/pages/Issue216.php
new file mode 100644
index 00000000..15491e2e
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Issue216.php
@@ -0,0 +1,14 @@
+<?php
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Issue216 extends TPage
+{
+ public function buttonClickCallback($sender, $param)
+ {
+
+ $this->result->setText('Tab ActiveIndex is : '.$this->tabpanel->ActiveViewIndex);
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php
new file mode 100644
index 00000000..1cfdf0cd
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php
@@ -0,0 +1,28 @@
+<?php
+
+class Issue216TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Issue216');
+ $this->assertTextPresent('TTabPanel doesn\'t preserve active tab on callback request');
+
+ $this->assertVisible('ctl0_Content_tab1');
+
+ $this->click("ctl0_Content_btn1");
+ $this->pause(800);
+
+ $this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 0");
+
+ $this->click("ctl0_Content_tab2_0");
+ $this->pause(800);
+
+ $this->assertVisible('ctl0_Content_tab2');
+
+ $this->click("ctl0_Content_btn1");
+ $this->pause(800);
+ $this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 1");
+ }
+}
+
+?> \ No newline at end of file