From d93af5633b1459cb670904b16c914e7313bbc576 Mon Sep 17 00:00:00 2001 From: "Christophe.Boulain" <> Date: Mon, 11 Jan 2010 12:48:47 +0000 Subject: Fixed Issue#216 --- .gitattributes | 3 +++ HISTORY | 1 + framework/Web/UI/WebControls/TTabPanel.php | 1 + .../tickets/protected/pages/Issue216.page | 15 ++++++++++++ .../tickets/protected/pages/Issue216.php | 14 +++++++++++ .../tickets/tests/Issue216TestCase.php | 28 ++++++++++++++++++++++ 6 files changed, 62 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Issue216.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Issue216.php create mode 100644 tests/FunctionalTests/tickets/tests/Issue216TestCase.php 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 @@ + +

TTabPanel doesn't preserve active tab on callback request

+ + + +

This is Tab 1

+
+ +

This is Tab 2

+
+
+ + + +
\ 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 @@ +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 @@ +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 -- cgit v1.2.3