summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2007-07-17 13:15:23 +0000
committerxue <>2007-07-17 13:15:23 +0000
commitfa46cf440d6ea3e506f5364825016feb73e211d8 (patch)
treeded2fede52b1fe8dbfcd472cd3b1637c25c31ea1 /framework
parent9ca0e83cc39d67c240ea89a2395d3bdb170fb4f7 (diff)
Fixed #656.
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index dd922431..eee5ac2f 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -617,8 +617,8 @@ class TDatePicker extends TTextBox
protected function renderCalendarDayOptions($writer, $selected=null)
{
$days = $this->getDropDownDayOptions();
- $writer->addAttribute('id', $this->getClientID().'_day');
- $writer->addAttribute('name', $this->getUniqueID().'$day');
+ $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day');
+ $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day');
$writer->addAttribute('class', 'datepicker_day_options');
if($this->getReadOnly() || !$this->getEnabled(true))
$writer->addAttribute('disabled', 'disabled');
@@ -651,8 +651,8 @@ class TDatePicker extends TTextBox
protected function renderCalendarMonthOptions($writer, $selected=null)
{
$info = $this->getLocalizedCalendarInfo();
- $writer->addAttribute('id', $this->getClientID().'_month');
- $writer->addAttribute('name', $this->getUniqueID().'$month');
+ $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month');
+ $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month');
$writer->addAttribute('class', 'datepicker_month_options');
if($this->getReadOnly() || !$this->getEnabled(true))
$writer->addAttribute('disabled', 'disabled');
@@ -698,8 +698,8 @@ class TDatePicker extends TTextBox
$years = array();
for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++)
$years[$i] = $i;
- $writer->addAttribute('id', $this->getClientID().'_year');
- $writer->addAttribute('name', $this->getUniqueID().'$year');
+ $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year');
+ $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year');
if($this->getReadOnly() || !$this->getEnabled(true))
$writer->addAttribute('disabled', 'disabled');
$writer->renderBeginTag('select');
@@ -767,6 +767,14 @@ class TDatePicker extends TTextBox
*/
protected function publishCalendarStyle()
{
+ if($this->getInputMode() === TDatePickerInputMode::DropDownList)
+ {
+ $page = $this->getPage();
+ $uniqueID = $this->getUniqueID();
+ $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'day');
+ $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'month');
+ $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'year');
+ }
$url = $this->getAssetUrl($this->getCalendarStyle().'.css');
$cs = $this->getPage()->getClientScript();
if(!$cs->isStyleSheetFileRegistered($url))