Well, technically what James told you is exactly what you want to do. But I do understand your frustration/confusion as I've had this issue before as well...
When creating a button, you can create it as a simple button, a toogle, a checkbox, or indeed a radio button.
However, these buttons are "dumb" and, as far as I know, there is no way to read what "state" they are in.
So as I've mentioned before, I would suggest that these options would be removed when creating a simple button...
Now, to your question...
1: Creating a radio-button to detect on/off state is not what the radio buttons were designed for when they first appeared in any shape or form.
A radio button is used when you want the user to be able to chose 1 of several options, but only 1 of those options.
What you're essentially looking for is a boolean (a true or false). For this, we have the checkbox.
2: To create a checkbox in DashBoard where you can read the state of the button when clicked, you have to create parameter to hold this value.
When you have created the parameter that shows up as a checkbox, you can add a task to this "parameter-button", that when clicked will run this task.
(Having it in a parameter also means you can check this value when other tasks are run)
Now, in the task, you have to get the value of self (or the parameter OID if you want), and do a single if/else check on it.
I've attached a working example below that updates a parameter when clicked.
<abs contexttype="opengear" gridsize="20" id="_top">
<meta>
<params>
<param access="1" constrainttype="INT_CHOICE" name="checkbox" oid="checkbox" precision="0" type="INT32" value="0" widget="checkbox">
<constraint key="0">Off</constraint>
<constraint key="1">On</constraint>
</param>
<param access="1" maxlength="0" name="text" oid="text" type="STRING" value="Checkbox is: UNCHECKED!" widget="label"/>
</params>
</meta>
<param expand="true" height="40" left="260" oid="checkbox" top="160" width="60">
<task tasktype="ogscript">var x = params.getValue('checkbox', 0); // We get the current value of the checkbox parameter and set as variable X
if (x == 1) { // We check to see if the checkbox is checked.
params.setValue('text', 0, 'Checkbox is: CHECKED!'); // If checked, we change the parameter/label text to reflect that it is indeed checked.
} else {
params.setValue('text', 0, 'Checkbox is: UNCHECKED!'); // if it's NOT checked, we change the text to reflect that it's not checked.
}</task>
</param>
<param expand="true" height="40" left="320" oid="text" style="size:Big;" top="160" width="260"/>
</abs>
If you want I can give you an example of how to use the radio buttons as well? However this will be more than 1 button. As that is just the nature of the radio button.
#DashBoard