Radio buttons
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Radio buttons
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.
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.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: Radio buttons
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
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.
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"
Re: Radio buttons
[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
is it possible to do something like this?
and not rename the radios?
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"
Code: Select all
do "set the hilite of btn"&yourVariable&" in group yard to true"
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: Radio buttons
Actually, yes. You are close.DavJans wrote: is it possible to do something like this?
and not rename the radios?Code: Select all
do "set the hilite of btn"&yourVariable&" in group yard to true"
Code: Select all
do "set the hilite of btn "&yourVariable&" of group yard to true"
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
..........
Last edited by [-hh] on Wed Aug 13, 2014 1:08 pm, edited 1 time in total.
shiftLock happens
Re: Radio buttons
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
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
Hey Klaus, do you mean I should avoid to name btt like this:
myBtt1
myBtt2
myBtt3
and so on...

myBtt1
myBtt2
myBtt3
and so on...

Discovering LiveCode Community 6.5.2.
Re: Radio buttons
No, I mean "pure" numbers like:
0
1
2
3
etc.
0
1
2
3
etc.

Re: Radio buttons
..........
Last edited by [-hh] on Wed Aug 13, 2014 1:08 pm, edited 2 times in total.
shiftLock happens
Re: Radio buttons
@atout66
Sorry for that
@Herrmann
Exactly!
Sorry for that

@Herrmann
Exactly!
Re: Radio buttons
For radio groups, also see the hilitedButtonName and the hilitedButton.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Radio buttons
Really good information from all of you, Thank you. I will rename my buttons as to not use numbers only.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här