TRadioButtonList displays a list of radiobuttons on a Web page. TRadioButtonList inherits all properties and events of {@link TCheckBoxList}. Each TRadioButtonList displays one group of radiobuttons, i.e., at most one radiobutton can be selected at a time.
Since: 3.0
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends TCheckBoxList
コード例 #1
0
 protected function createEnumControl($container, $column, $record)
 {
     $value = $this->getRecordPropertyValue($column, $record);
     $selectedValues = preg_split('/\\s*,\\s*/', $value);
     $control = new TRadioButtonList();
     $values = $column->getDbTypeValues();
     $control->setDataSource($values);
     $control->dataBind();
     $index = $this->getMatchingIndices($values, $selectedValues);
     if (count($index) > 0) {
         $control->setSelectedIndex($index[0]);
     }
     $control->setID(self::DEFAULT_ID);
     $control->setCssClass('enum-radio-buttons');
     $this->setNotNullProperty($container, $control, $column, $record);
     return $control;
 }
コード例 #2
0
ファイル: TRatingList.php プロジェクト: pradosoft/prado
 /**
  * Add rating style class name to the class attribute
  * when {@link setReadOnly ReadOnly} property is true and when the
  * {@link setCssClass CssClass} property is empty.
  * @param THtmlWriter renderer
  */
 public function render($writer)
 {
     $writer->addAttribute('id', $this->getClientID());
     $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions());
     parent::render($writer);
 }
コード例 #3
0
 /**
  * Ensure that the ID attribute is rendered and registers the javascript code
  * for initializing the active control.
  */
 protected function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
 }