/**
  * Sets items from which to choose.
  * @param  array
  * @param  bool
  * @return self
  */
 public function setItems(array $items, $useKeys = TRUE)
 {
     parent::setItems($items, $useKeys);
     if ($this->tempValue != NULL) {
         parent::setValue($this->tempValue);
     }
 }
示例#2
0
 public function setValue($value)
 {
     $form = $this->getForm(FALSE);
     if ($form) {
         $this->refresh($form);
     }
     parent::setValue($value);
     return $this;
 }
 /**
  * Set value of selectbox
  * @param mixed $value
  * @param boolean $refreshTree Remake tree of components? (false only for internal system)
  */
 public function setValue($value, $refreshTree = true)
 {
     if ($value !== null && !$this->hasEmptyValue() && $this->hasAnyParentEmptyValue()) {
         throw new LogicException("Cant set value of dependent component when parent have no value ! (Control: '{$this->name}')");
     }
     $value = $value === FALSE ? NULL : $value;
     parent::setValue($value);
     if ($refreshTree && !$this->hasEmptyValue()) {
         $this->refresh(false);
     }
     return $this;
 }
 /**
  * Sets items from which to choose.
  * @param  array
  * @param  bool
  * @return self
  */
 public function setItems(array $items, $useKeys = TRUE)
 {
     parent::setItems($items, $useKeys);
     if ($this->tempValue != NULL) {
         if ($this->multiple) {
             $this->setMultipleValue($this->tempValue);
         } else {
             parent::setValue($this->tempValue);
         }
     }
 }