Prado\Web\UI\WebControls\TTextBox::loadPostData PHP Method

loadPostData() public method

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
return boolean whether the data of the component has been changed
    public function loadPostData($key, $values)
    {
        $value = $values[$key];
        if ($this->getAutoTrim()) {
            $value = trim($value);
        }
        if (!$this->getReadOnly() && $this->getText() !== $value) {
            $this->setText($value);
            return $this->_dataChanged = true;
        } else {
            return false;
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Loads user input data. Override parent implementation, when InputMode
  * is DropDownList call getDateFromPostData to get date data.
  * This method is primarly used by framework developers.
  * @param string the key that can be used to retrieve data from the input data collection
  * @param array the input data collection
  * @return boolean whether the data of the component has been changed
  */
 public function loadPostData($key, $values)
 {
     if ($this->getInputMode() == TDatePickerInputMode::TextBox) {
         return parent::loadPostData($key, $values);
     }
     $value = $this->getDateFromPostData($key, $values);
     if (!$this->getReadOnly() && $this->getText() !== $value) {
         $this->setText($value);
         return true;
     } else {
         return false;
     }
 }