RadioButton

From WebOS101

Jump to: navigation, search

Introduction

The RadioButton widget allows the user to basically select a single option from a list of options. It's the virtual equivalent of the old time cassette player buttons where only one button could be pressed down at any given moment. Just like all other widgets the important thing is the events it exposes to the programmer and with the RadioButton we have several to play with. The palm reference page does a pretty good job of explaining how to set it up and if you know how to handle events from a regular button then you should have no trouble handling events from a RadioButton. I usually use Ares because Ares exposes all the events in a really simple way.

Events

For the RadioButton Ares exposes 4 events in the events tab called ontap, onhold, onholdEnd, and onchange. It's pretty easy to find the corresponding events in the Mojo.Event namespace. ontap corresponds to Mojo.Event.tap, onhold to Mojo.Event.hold, onholdEnd to Mojo.Event.holdEnd, finally and most importantly onchange corresponds to Mojo.Event.propertyChange.

Personal tools