Пример #1
0
 /**
  * Client-side Text property can only be updated after the OnLoad stage.
  * @param string text content for the textbox
  */
 public function setText($value)
 {
     if (parent::getText() === $value) {
         return;
     }
     parent::setText($value);
     if ($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) {
         $cb = $this->getPage()->getCallbackClient();
         $cb->setValue($this, $value);
         if ($this->getInputMode() == TDatePickerInputMode::DropDownList) {
             $s = new TDateTimeStamp();
             $date = $s->getDate($this->getTimeStampFromText());
             $id = $this->getClientID();
             $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'day', 'Value', $date['mday'], 'select');
             $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'month', 'Value', $date['mon'] - 1, 'select');
             $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'year', 'Value', $date['year'], 'select');
         }
     }
 }