Page 1 of 2
Problems with grouped radio buttons
Posted: Tue Dec 29, 2009 10:00 pm
by exheusden
Highlighted on page 110 of the Revolution Users Guide is the following:
Note: Revolution will automatically enforce the rule of highlighting one radio button at
a time if you place the radio buttons together in a group.
So what happened here?
http://users.telenet.be/davidneale/varia/buttons.png
As you can see, this is a group of three radio buttons, yet two of them are highlighted. Have I specified something incorrectly in the Properties?
I am using Revolution Media 4.0.0
Re: Problems with grouped radio buttons
Posted: Wed Dec 30, 2009 3:24 pm
by Klaus
Hi,
hmmm, looks definitively OK...
Any chance this happend by a script somehow?
Or do you mean that you can actually click/hilite more than one radio button of that group at a time?
Hint:
Since I work with MetaCard/Rev for more than 10 years now, I found that things like these (strange, "must work", unexplainable and mostly unreproducable)
are not worth to spend much time on them. I usually delete the "control to blame" and create a new one, which always works as exspected
Best
Klaus
Re: Problems with grouped radio buttons
Posted: Wed Dec 30, 2009 4:17 pm
by exheusden
No scripts involved. A simple group and a couple of clicks. I didn't have this problem in the previous version of RevMedia, so maybe it's a version 4 bug. Ah well.
Re: Problems with grouped radio buttons
Posted: Wed Dec 30, 2009 8:05 pm
by sturgis
Under the basic properties, make sure the "hilite one radio button at a time" checkbox hasn't been dechecked.
Re: Problems with grouped radio buttons
Posted: Wed Dec 30, 2009 9:07 pm
by exheusden
Hello Sturgis,
That option is checked in basic properties (see PNG file linked to in my original post).
Re: Problems with grouped radio buttons
Posted: Wed Dec 30, 2009 9:29 pm
by sturgis
Oh duh.

too used to ignoring links in forums my apologies.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 1:23 am
by exheusden
I started afresh and now the single-button highlighting seems to function correctly.
Next Problem!
In order to know which button must be highlighted when a card is navigated to, I thought I'd keep things simple and just store the name of the highlighted button in a field. I therefore put the following code into a script at the button-group level:
on mouseUp
put the hilitedButtonName of me into fld "RecordingType"
end mouseUp
But this puts nothing at all into the field "RecordingType".
I also tried with the short name -- same nothingness.
There are no scripts attached to the individual radio buttons.
What am I doing wrong?
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 2:02 am
by sturgis
putting the following into the group script
Code: Select all
on mouseUp
put the hilitedButtonName of me
end mouseUp
puts the hilited button name into the msg box for me. Where did you put your script?
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 2:15 am
by sturgis
Just did a quick test. If the code you posted is indeed in the group script, but nothing happens when you click your radio buttons you might check to see if you have empty on mouseUP /end mouseUp blocks in your radio buttons with no other code. If you do the code in the group is ignored and no error is generated.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 3:08 am
by exheusden
Thanks for that, Sturgis.
Indeed, when I look at the script for the individual radio buttons, there are empty on mouseUp…end mouseUp scripts, apparently placed automatically by Revolution. Even when I remove these (and even compile the completely empty script field, just to be sure), the result remains the same: nothing gets put in the field.
When looking at the individual buttons, however, I noticed a "Shared hilite" flag, which was selected (presumably the default), so I deselected this flag for each of the buttons, and this does what I want, without the need of the field. Hope this is correct, revolution-wise.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 11:24 am
by exheusden
sturgis wrote:putting the following into the group script
Code: Select all
on mouseUp
put the hilitedButtonName of me
end mouseUp
puts the hilited button name into the msg box for me. Where did you put your script?
I put the script in the group script level.
I also tried your simple put and that puts absolutely nothing into the message box.
Actually, this will be a problem in the future, as I will need to identify the selected button and use its name in some HTML code. As the group script fails to work, I shall have to examine each button individually. Can be done, of course, but I'd far prefer to do this sort of thing at the group level.
I'm using RevMedia 4.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 4:33 pm
by sturgis
There are no errors? If not it still seems to me that somewhere in your code is a mouseUp handler thats snagging the click and not letting it get to the script in the group.
Either way, you shouldn't have to examine the individual buttons as you can do:
Code: Select all
put the hilitedButtonName of group "groupname"
and it should respond. In fact if you try it in the msg box explicitly defining the group it should tell you which button is hilited. If it doesn't, something is.. to use a technical term.. Horked.
If running the code from the msg box DOES work then my previous guess about from above is probably the issue which is why I asked if you had extra mouseUp s laying around.
You might be interested in
http://www.runrev.com/developers/lesson ... g-started/ especially the part about the message path. Also
http://www.fourthworld.com/embassy/arti ... _path.html which has more depth and is well written.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 6:22 pm
by exheusden
I'd already tried to run the put command from the message box in order to display the name of the highlighted button (hilitedButtonName) -- it shows nothing in the message box, either. For me, if it doesn't work from the message box, then there might be a problem with Revolution itself.
I therefore created a small test project, containing only a group of buttons. Interestingly, when I make a group script in that, Revolution asks me if I wish to save the script for the group (this did not happen in the original project). The script (exactly the same as in the original project) works fine.
I am familiar with the message path from both HC and SC, so that's not the problem. The project is fairly large, and I am certainly not comfortable with the lack of a clear background, which, of course, I am used to dealing with from HC and SC -- I particularly dislike nesting groups.
I'll probably return to a backup of the project, prior to the addition of the radio buttons group, and try from there again.
Thanks for the links. I'll take a look at the information there.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 6:40 pm
by exheusden
At last!
Having returned to the backup and gone through the same group setup procedure, the use of hilitedButtonName now works correctly.
Thanks for your help and patience.
Re: Problems with grouped radio buttons
Posted: Thu Dec 31, 2009 8:02 pm
by sturgis
Hate it when that happens. It was probably a "random feature." I have a stack here that recently blew up for no reason I can figure out. And unlike you I don't have incremental backups of this one since its just a "try things out" stack that ended up being pretty useful. The random feature in this is that I get to rebuild the whole thing from scratch and this time it will be done better.