diff options
author | Christophe.Boulain <> | 2009-04-08 07:06:36 +0000 |
---|---|---|
committer | Christophe.Boulain <> | 2009-04-08 07:06:36 +0000 |
commit | d042fed88e7ed55e2a7deee037c8073e6c545290 (patch) | |
tree | 00709c8d5b8283c676d8edc4e308c3aefc8d210d | |
parent | bd2d05119734a7892485cfe3c7bc62a4a606ce6d (diff) |
Fixed Issue#136
6 files changed, 34 insertions, 6 deletions
@@ -12,7 +12,8 @@ BUG: Issue#107 - typo in TDbConnection::getCharset() (Christophe) BUG: Issue#126 - THtmlArea: boolean options output as strings (Christophe) BUG: Issue#127 - TDataSourceConfig::findConnectionByID try to access private var (Cristophe) BUG: Issue#129 - TDbLogRoute::init don't close the sql command (Christophe) -Bug: Issue#130 - TDbLogRoute::processLogs wrong values binding (Christophe) +BUG: Issue#130 - TDbLogRoute::processLogs wrong values binding (Christophe) +BUG: Issue#136 - TActiveDatePicker don't callback when ShowCalendar is false (Christophe) CHG: Issue#7 - Clients Scripts are not combined anymore in Debug application mode (Christophe) ENH: Issue#115 - Registry for Prado generated clientside counterparts of serverside controls (Yves Berkholz) ENH: Added caching of message files to TException (Michael) diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js index 87b48bf3..3aacda21 100755 --- a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js @@ -33,7 +33,8 @@ Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker, Object.extend(this,options); - Event.observe(this.trigger, triggerEvent, this.show.bindEvent(this)); + if (this.options.ShowCalendar) + Event.observe(this.trigger, triggerEvent, this.show.bindEvent(this)); // Listen to change event if(this.options.InputMode == "TextBox") diff --git a/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/framework/Web/UI/ActiveControls/TActiveDatePicker.php index 052ed199..4ef43198 100755 --- a/framework/Web/UI/ActiveControls/TActiveDatePicker.php +++ b/framework/Web/UI/ActiveControls/TActiveDatePicker.php @@ -39,6 +39,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I protected function getDatePickerOptions(){ $options = parent::getDatePickerOptions(); $options['EventTarget'] = $this->getUniqueID(); + $options['ShowCalendar'] = $this->getShowCalendar(); return $options; } @@ -108,8 +109,8 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I */ protected function registerCalendarClientScript() { - if($this->getShowCalendar()) - { + // if($this->getShowCalendar()) + // { $cs = $this->getPage()->getClientScript(); $cs->registerPradoScript("activedatepicker"); @@ -123,7 +124,7 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I $options = TJavaScript::encode($this->getDatePickerOptions()); $code = "new Prado.WebUI.TActiveDatePicker($options);"; $cs->registerEndScript("prado:".$this->getClientID(), $code); - } + // } } } ?> diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page index ed35293e..64f37867 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page @@ -11,6 +11,14 @@ <com:TActiveButton ID="increaseButton" OnClick="increase" Text="+1" OnCallback="testDatePicker"/> <com:TButton ID="toggleButton" OnClick="toggleMode" Text="Toggle input mode (postback)"/> </p> +<p> +ShowCalendar=false +</p> +<p> +<com:TActiveDatePicker ID="datepicker2" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker2" InputMode="DropDownList" ShowCalendar="false"/> +<com:TActiveLabel ID="status2" /><br/> +</p> + </com:TForm> </body> diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php index 6d78a664..4897a146 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php @@ -14,6 +14,10 @@ class ActiveDatePicker extends TPage { $this->status->Text = $this->datepicker->getText(); } + public function testDatePicker2($sender, $param){ + $this->status2->Text = $this->datepicker2->getText(); + } + public function today ($sender, $param) { $this->datepicker->setTimestamp(time()); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php index b8e9594e..5faee611 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php @@ -35,7 +35,7 @@ class ActiveDatePickerTestCase extends SeleniumTestCase $this->verifyText("status", date('m-d-Y', strtotime('+1 month'))); $this->click('toggleButton'); - $this->pause(1000); + $this->pause(2000); $this->click("todayButton"); $this->pause(800); @@ -91,6 +91,19 @@ class ActiveDatePickerTestCase extends SeleniumTestCase $this->verifySelected("datepicker_day", date('d', $dateToCheck)); $this->verifySelected("datepicker_year", date('Y', $dateToCheck)); $this->verifyText("status", date('m-d-Y', $dateToCheck)); + + $this->click('ctl1'); + $this->pause(800); + + $this->verifyText("status2", ""); + $dateToCheck=time(); + $this->verifySelected("datepicker2_month", date('m', $dateToCheck)); + $this->verifySelected("datepicker2_day", date('d', $dateToCheck)); + $this->verifySelected("datepicker2_year", date('Y', $dateToCheck)); + $this->select("datepicker2_year", 2005); + $this->pause(800); + $dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), 2005); + $this->verifyText("status2", date('m-d-Y', $dateToCheck)); } } |