RadioButton

A RadioButton object represents a radio button. The RadioButton class is a subclass of BaseListItem, which is derived from BaseValueComponent. The class hierarchy for RadioButton is shown in Figure 2.17.

Figure 2.17. The class hierarchy for RadioButton


Table 2.14 shows the attribute defined in the BaseListItem class and Table 2.15 shows the attribute defined in RadioButton.

Table 2.14. The attribute in the RadioButton class
NameUsageTypeDefaultAccessibility
onselectedTag and JSexpressionnullread-write
 Description. Invoked when this item is selected.

Table 2.15. The attribute in the RadioButton class
NameUsageTypeDefaultAccessibility
text_yTag and JSnumbercenteredread-write
 Description. The y position of the text label.

No new methods are defined in BaseListItem and RadioButton.

The code in Listing 2.13 shows an LZX application that uses RadioButton. Note that you can create a RadioButton by using the radiobutton tag. The radiogroup tag is used to group radio buttons in the same selection.

Listing 2.13. Using RadioButton
<canvas height="150">
    <radiogroup>
        <radiobutton text="Red"/>
        <radiobutton text="Green"/>
        <radiobutton text="Blue"/>
    </radiogroup>
</canvas>

You can invoke the code in Listing 2.13 using this URL:

http://localhost:8080/lps-4.0.x/app02/radioTest1.lzx

The generated output is shown in Figure 2.18.

Figure 2.18. Using radios


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset