Radio Buttons Overview
-
Navigate to HSYCO Manager
-
Create a new project or open an existing one
- Go into the Home page
- Click "add"
- Add the first "Radiobutton"
- Go back to "edit" mode
- Change the "Label" to "Button 1"
8. Change the "Name" to "button1". This is the name of the command sent to the server
- Change the "Group" to "group1"
10. Change the "Value When Selected" to "true". This is the value that will be passed to the server if the button is selected
11. Change the "Value" to "false". This is the standard value of the button when it is not selected
**12. Change the "Auto Send" to "false". We'll have a submit button so we don't want to auto send the values **
- Right click the button and click "Duplicate"
- Select the duplicated button
- Change the "Label" to "Button 2"
16. Change the "Name" to "button2". Leave the other parameters as the other button
- Right Click and select again "Duplicate"
- Select the third button and change its "Label" to "Button 3"
- Change the "Name" to "button3".
- Change the "Group" to "group2" and leave the other parameters as the other buttons
- Click "add"
- Add a "Button"
- Click "edit"
- Change the "Label" to "Submit"
- Change the "Action" to "submit"
- Select all the four object, click "Align" and then "Center Selection Vertically" and "Center Selection Horizontally" to center all the elements in the middle of the page
- Click "Save" to save the project
- Click "Run" and then "Default" to launch the application
- The page should look like this:
- If we select one of the first two buttons, the other will be automatically ticked because they are grouped togheter
- Click "Submit" to send the values to the server
32. If we look in the "Log Viewer", the three buttons names and values have been passed to the server. The pattern is name@value and it is repeated for the number of buttons. In this case, the first two buttons have a "true" value while the third has "false" because it wasn't ticked.
- If we instead select only the third button, the first two are not selected automatically because they are in a different group from the third. Click "Submit" to send the values
- As you can see from the "Log Viewer", the first two buttons have a "false" value while the third is "true"