Page 1 of 1
Radio buttons
Posted: Fri Apr 18, 2014 10:28 pm
by DavJans
I have almost finished a card that will set permission levels for users, I have everything that I want working but I cant find an example for this last step. Hopefully I can explain what i need easily enough.
I have 3 columns with 3 radio buttons each, they are grouped. the groups are tracker, report, and yard (Group yard has radio buttons names 0, 1 and 2) the radio button names are the same in each group
The info is stored in a mysql database and my user list shows up in a datagrid.
so far then I select user1 in the datagrid I get a variable that looks like this 1,1,1 if I select user2 I get 2,2,2
basically I'm getting the data from the mysql server comma delimited and each value is the name of the radio button (levels of access)
what I would like is that when I select a different use in the data grid and get the variable I want to somehow translate that into the correct radio button getting automatically selected.
Re: Radio buttons
Posted: Fri Apr 18, 2014 10:47 pm
by magice
put each of the 3 numbers in separate variables
then name the radio buttons with a name then numbers 1-10. something like yard1, yard2, yard3 etc.then try this in the script
Code: Select all
do "set the hilite of btn yard"&yourVariable&" to true"
now i am sure that there is a way to do it without the do command, but I always get compilation errors and this is my way of cheating.
Re: Radio buttons
Posted: Fri Apr 18, 2014 11:00 pm
by DavJans
[quote="magice"]put each of the 3 numbers in separate variables
then name the radio buttons with a name then numbers 1-10. something like yard1, yard2, yard3 etc.then try this in the script
Code: Select all
do "set the hilite of btn yard"&yourVariable&" to true"
is it possible to do something like this?
Code: Select all
do "set the hilite of btn"&yourVariable&" in group yard to true"
and not rename the radios?
Re: Radio buttons
Posted: Sat Apr 19, 2014 12:24 am
by magice
DavJans wrote:
is it possible to do something like this?
Code: Select all
do "set the hilite of btn"&yourVariable&" in group yard to true"
and not rename the radios?
Actually, yes. You are close.
Code: Select all
do "set the hilite of btn "&yourVariable&" of group yard to true"
be aware though, that the number of each button is determined by its order of creation (or the order of the id number). For that reason I like to reference buttons by name, but then I am a control freak.
In fact, I think you can eliminate the do command and just say
Code: Select all
set the hilite of btn yourVariable of group yard to true
Re: Radio buttons
Posted: Sat Apr 19, 2014 2:49 am
by [-hh]
..........
Re: Radio buttons
Posted: Sat Apr 19, 2014 1:10 pm
by Klaus
Hi friends,
a general hint: Do not name any objects with a NUMBER!
That is asking for trouble and even RunRev advises against it!
Best
Klaus
Re: Radio buttons
Posted: Sat Apr 19, 2014 1:18 pm
by atout66
Hey Klaus, do you mean I should avoid to name btt like this:
myBtt1
myBtt2
myBtt3
and so on...

Re: Radio buttons
Posted: Sat Apr 19, 2014 1:34 pm
by Klaus
No, I mean "pure" numbers like:
0
1
2
3
etc.

Re: Radio buttons
Posted: Sat Apr 19, 2014 1:38 pm
by [-hh]
..........
Re: Radio buttons
Posted: Sat Apr 19, 2014 1:40 pm
by atout66
Ah, I prefer, you scared me! (to Klaus)
Re: Radio buttons
Posted: Sat Apr 19, 2014 2:02 pm
by Klaus
@atout66
Sorry for that
@Herrmann
Exactly!
Re: Radio buttons
Posted: Sat Apr 19, 2014 5:45 pm
by jacque
For radio groups, also see the hilitedButtonName and the hilitedButton.
Re: Radio buttons
Posted: Mon Apr 21, 2014 4:04 pm
by DavJans
Really good information from all of you, Thank you. I will rename my buttons as to not use numbers only.