<?phpclass Radiobutton01 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : Simple radio button"; $this->render = new WSPObject(); $radio = new RadioButtonGroup($this); $radio->addRadioButton("My radio button"); $this->render->add($radio); }}?>
<?phpclass Radiobutton02 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : 2 Radio buttons"; $this->render = new WSPObject(); $radio = new RadioButtonGroup($this); $radio->addRadioButton("Radio 1"); $radio->addRadioButton("Radio 2"); $radio->setValue("Radio 2"); // init selected radio $this->render->add($radio); }}?>
<?phpclass Radiobutton03 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : Radio button onchange event"; $this->render = new Form($this); $radio = new RadioButtonGroup($this->render); $radio->addRadioButton("Radio 1"); $radio->addRadioButton("Radio 2"); $radio->onChange("onChangeRadio"); $this->render->setContent($radio); } public function onChangeRadio($sender) { alert("Radio value is ".$sender->getValue()."."); }}?>
<?phpclass Radiobutton04 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : 2 Radio buttons disabled"; $this->render = new WSPObject(); $radio = new RadioButtonGroup($this); $radio->addRadioButton("Radio 1"); $radio->addRadioButton("Radio 2"); $radio->setValue("Radio 2"); // init selected radio $radio->disable(); $this->render->add($radio); }}?>