Pseudo Radio Buttons (from CheckBoxes)

187 views
Skip to first unread message

Scott Ferguson

unread,
Feb 10, 2016, 8:37:10 AM2/10/16
to App Inventor Developers Library
Create groups of CheckBoxes to be used as radio buttons.
When one of the checkboxes in a group is checked, the others are cleared.
A Changed event is used for each checkbox and each should contain the TickCheckBox procedure.
The TickCheckbox procedure tests if the checkbox was checked.
if so, it clears all checkboxes in the group then sets the selected checkbox.

Two procedures with result are included:

CheckBoxesSelection returns either a group's ticked checkbox text or empty text if none was ticked
CheckBoxesSelectionIndex returns either a group's ticked checkbox index or 0 if none was ticked

Any number of checkboxes in a group is supported so this is a general solution.
---
PseudoRadioButtons.aia
blocks.PNG
Screenshot_2016-02-10-07-22-00.png

Sjaak Bosman

unread,
Jul 30, 2016, 9:27:17 AM7/30/16
to App Inventor Developers Library
Scott,

By using .Checked the user is able to uncheck a checked checkbox, leaving the radio button group with no selection at all. You can find a detailed description on how to avoid that on http://appinventor.mit.edu/explore/blogs/karen/2016/07-0.html. At a glance:




Grtz,

Sjaak

Op woensdag 10 februari 2016 14:37:10 UTC+1 schreef Scott Ferguson:

Scott Ferguson

unread,
Jul 31, 2016, 6:30:51 AM7/31/16
to App Inventor Developers Library
Thanks for pointing this out, and nice tutorial!
---

Sjaak Bosman

unread,
Jul 31, 2016, 2:51:02 PM7/31/16
to App Inventor Developers Library
Thanks Scott :-)
Reply all
Reply to author
Forward
0 new messages