summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2007-03-30 11:15:23 +0000
committerwei <>2007-03-30 11:15:23 +0000
commitd223df797d277acc61b47e9303a0c2537c72d9e7 (patch)
treeb9f8fb6cb3ec6135f3a111356794cf9118bd5217
parent9db5f1ef950e571d19cc70f1b22da1d77f22448b (diff)
Fixed #526
-rw-r--r--.gitattributes4
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php14
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket504.page4
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket526.page8
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket526.php15
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket504TestCase.php53
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket526TestCase.php18
8 files changed, 114 insertions, 3 deletions
diff --git a/.gitattributes b/.gitattributes
index 64e443df..8345a7ff 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2405,6 +2405,8 @@ tests/FunctionalTests/tickets/protected/pages/Ticket511.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket518.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket521.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket521.php -text
+tests/FunctionalTests/tickets/protected/pages/Ticket526.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket526.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket538.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket538.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket54.page -text
@@ -2440,8 +2442,10 @@ tests/FunctionalTests/tickets/tests/Ticket463TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket470TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket477TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket488TestCase.php -text
+tests/FunctionalTests/tickets/tests/Ticket504TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket507TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket521TestCase.php -text
+tests/FunctionalTests/tickets/tests/Ticket526TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket538TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket54TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket573TestCase.php -text
diff --git a/HISTORY b/HISTORY
index 35765681..c4d90349 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,7 @@ BUG: Ticket#278 - client-side validator enable/disable (conditional) (Wei)
BUG: Ticket#492 - TDataGridPagerStyle not found error (Qiang)
BUG: Ticket#517 - Quickstart I18N sample: conflicting module ID (Wei)
BUG: Ticket#521 - comment tag on TActiveButton stop callback (Wei)
+BUG: Ticket#526 - TDatePicker Mode="Button" with ActivePanel Enabled="false" (Wei)
BUG: Ticket#538 - TActiveListBox doesn't support optgroup (Wei)
BUG: Ticket#549 - set/get Timestamp on TDatePicker shound handle "null" values (Qiang)
BUG: Ticket#550 - explicitly include TCallbackClientSide in TCallbackOptions (Qiang)
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 9ee24b53..3e85ffb9 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -378,12 +378,16 @@ class TDatePicker extends TTextBox
*/
protected function renderDatePickerButtons($writer)
{
- if($this->getShowCalendar() && $this->getEnabled(true))
+ if($this->getShowCalendar())
{
switch ($this->getMode())
{
- case TDatePickerMode::Button: $this->renderButtonDatePicker($writer); break;
- case TDatePickerMode::ImageButton : $this->renderImageButtonDatePicker($writer); break;
+ case TDatePickerMode::Button:
+ $this->renderButtonDatePicker($writer);
+ break;
+ case TDatePickerMode::ImageButton :
+ $this->renderImageButtonDatePicker($writer);
+ break;
}
}
}
@@ -718,6 +722,8 @@ class TDatePicker extends TTextBox
$writer->addAttribute('type', 'button');
$writer->addAttribute('class', $this->getCssClass().' TDatePickerButton');
$writer->addAttribute('value',$this->getButtonText());
+ if(!$this->getEnabled(true))
+ $writer->addAttribute('disabled', 'disabled');
$writer->renderBeginTag("input");
$writer->renderEndTag();
}
@@ -734,6 +740,8 @@ class TDatePicker extends TTextBox
$writer->addAttribute('src', $url);
$writer->addAttribute('alt', ' ');
$writer->addAttribute('class', $this->getCssClass().' TDatePickerImageButton');
+ if(!$this->getEnabled(true))
+ $writer->addAttribute('disabled', 'disabled');
$writer->renderBeginTag('img');
$writer->renderEndTag();
}
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
index 0242dd97..767a9c3a 100644
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
@@ -25,24 +25,28 @@
<com:TActiveLinkButton
Text="Tab A"
+ ID="linka"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelA"
/>
<com:TActiveLinkButton
Text="Tab B"
+ ID="linkb"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelB"
/>
<com:TActiveLinkButton
Text="Tab C"
+ ID="linkc"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelC"
/>
<com:TActiveLinkButton
Text="Tab D"
+ ID="linkd"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelD"
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket526.page b/tests/FunctionalTests/tickets/protected/pages/Ticket526.page
new file mode 100644
index 00000000..5aa84b87
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket526.page
@@ -0,0 +1,8 @@
+<com:TContent ID="Content">
+<com:TActivePanel ID="activePanel">
+ <com:TDatePicker ID="dp"/>
+ <com:TActiveTextbox ID="textbox" Text="text" />
+ <com:TActiveButton ID="btn" Text="Btn" OnCallback="callback"/>
+</com:TActivePanel>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket526.php b/tests/FunctionalTests/tickets/protected/pages/Ticket526.php
new file mode 100644
index 00000000..9afaf28f
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket526.php
@@ -0,0 +1,15 @@
+<?php
+
+Prado::using('System.Web.UI.ActiveControls.*');
+class Ticket526 extends TPage
+{
+ public function callback($s, $p)
+ {
+ $this->dp->Mode="Button";
+ $this->textbox->Text = 'callback';
+ $this->activePanel->Enabled="false";
+ $this->activePanel->render($p->NewWriter);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php
new file mode 100644
index 00000000..7c74a1d1
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket504TestCase.php
@@ -0,0 +1,53 @@
+<?php
+
+class Ticket504TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = 'ctl0_Content_';
+ $this->open('tickets/index.php?page=Ticket504');
+ $this->verifyTitle("Verifying Ticket 504", "");
+
+ $this->assertText("status", "");
+
+ $this->assertVisible("{$base}panelA");
+ $this->assertVisible("{$base}panelB");
+ $this->assertVisible("{$base}panelC");
+ $this->assertVisible("{$base}panelD");
+
+ $this->click("{$base}linka");
+ $this->pause(800);
+ $this->assertVisible("{$base}panelA");
+ $this->assertNotVisible("{$base}panelB");
+ $this->assertNotVisible("{$base}panelC");
+ $this->assertNotVisible("{$base}panelD");
+ $this->assertText("status", "panelA updated");
+
+ $this->click("{$base}linkb");
+ $this->pause(800);
+ $this->assertNotVisible("{$base}panelA");
+ $this->assertVisible("{$base}panelB");
+ $this->assertNotVisible("{$base}panelC");
+ $this->assertNotVisible("{$base}panelD");
+ $this->assertText("status", "panelB updated");
+
+ $this->click("{$base}linkc");
+ $this->pause(800);
+ $this->assertNotVisible("{$base}panelA");
+ $this->assertNotVisible("{$base}panelB");
+ $this->assertVisible("{$base}panelC");
+ $this->assertNotVisible("{$base}panelD");
+ $this->assertText("status", "panelC updated");
+
+ $this->click("{$base}linkd");
+ $this->pause(800);
+ $this->assertNotVisible("{$base}panelA");
+ $this->assertNotVisible("{$base}panelB");
+ $this->assertNotVisible("{$base}panelC");
+ $this->assertVisible("{$base}panelD");
+ $this->assertText("status", "panelD updated");
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php
new file mode 100644
index 00000000..abba3a96
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket526TestCase.php
@@ -0,0 +1,18 @@
+<?php
+
+class Ticket526TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base="ctl0_Content_";
+ $this->open('tickets/index.php?page=Ticket526');
+ $this->verifyTitle("Verifying Ticket 526", "");
+
+ $this->assertElementNotPresent("{$base}dpbutton");
+
+ $this->click("{$base}btn");
+ $this->pause(800);
+ $this->assertElementPresent("{$base}dpbutton");
+ }
+}
+?> \ No newline at end of file