Prado\Web\UI\TControl::setViewState PHP Method

setViewState() public method

This function is very useful in defining setter functions for control properties that must be kept in viewstate. Make sure that the viewstate value must be serializable and unserializable.
public setViewState ( $key, $value, $defaultValue = null )
    public function setViewState($key, $value, $defaultValue = null)
    {
        if ($this->_trackViewState) {
            unset($this->_tempState[$key]);
            $this->_viewState[$key] = $value;
        } else {
            unset($this->_viewState[$key]);
            if ($value === $defaultValue) {
                unset($this->_tempState[$key]);
            } else {
                $this->_tempState[$key] = $value;
            }
        }
    }
TControl