I often default groups of radio buttons to have no default value–having no default works great for situations where you want to visually show that the user hasn’t selected anything yet (such as a survey question or numerous business scenarios).
I don’t want to hard-code the positions of the buttons because I want to maintain the freedom to quickly/instantly re-arrange the layout of options without needing to change any code. I’ve resorted to something like the following, which is working fine for me in 2018r2, but I suspect I’m missing a better way:
if myWebRadioGroup.SelectedCell.left=-1 then
''''NOTHING SELECTED YET, SO DO SOMETHING APPROPRIATE
elseif myWebRadioGroup.SelectedCaption="Option x" then
''''DO OTHER STUFF THAT'S APPROPRIATE FOR OPTION X
elseif myWebRadioGroup.SelectedCaption="Option y" then
''''DO OPTION Y APPROPRIATE STUFF
else
''''DO STUFF FOR OPTION Z
end if
I feel like there should be a quicker/easier/cleaner way. My natural inclination is to just leave out the first IF that checks the SelectedCell.left, but it turns out that checking SelectedCaption seems to crash the app if none of the radio buttons are selected. Otherwise, I’d be happy with that option…
What am I missing?