Prado\Web\UI\WebControls\TDropDownList::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)
    {
        if (!$this->getEnabled(true)) {
            return false;
        }
        $this->ensureDataBound();
        $selection = isset($values[$key]) ? $values[$key] : null;
        if ($selection !== null) {
            $index = $this->getItems()->findIndexByValue($selection, false);
            if ($this->getSelectedIndex() !== $index) {
                $this->setSelectedIndex($index);
                return $this->_dataChanged = true;
            }
        }
        return false;
    }