View Full Version : Radio Selection - Jump to Last Screen
GalacTekM
09-23-2008, 10:47 AM
Have a project that contains radio selection box that im having some troubles with. This is what i am trying to accomplish.
If the user selects yes (CTRL_RADIO_BUTTON_01) then i would like the installer to continue on as normal.
If the user selects no (CTRL_RADIO_BUTTON_02) then i would like the installer to skip the next screen(s) and go the the "Finished Install" screen.
Is this a possibility or am i chasing my tail? Any help would be appreciated.
Thanks.
jassing
09-23-2008, 10:55 AM
Have a project that contains radio selection box that im having some troubles with. This is what i am trying to accomplish.
If the user selects yes (CTRL_RADIO_BUTTON_01) then i would like the installer to continue on as normal.
If the user selects no (CTRL_RADIO_BUTTON_02) then i would like the installer to skip the next screen(s) and go the the "Finished Install" screen.
Is this a possibility or am i chasing my tail? Any help would be appreciated.
Thanks.
The "stock" way of doing it would be to use an if/endif block on your OnNext
if the user selects radio#2 then
screen.jump("the screen you want them to go to")
else
screen.next()
end
a better way (IMHO) is to use the ConditionalScreens.lua script file (search for it in the forums) -- it allows you to skip screens.. so in the screen you want to "skip" you would put, in onpreload:
if RadioButton == 2 then
Screen.Skip();
end
this requires you to use different calls in your other screens.
Screen.GoNext() instead of Screen.Next()
Screen.GoBack() instead of Screen.Back()
this is better because if the user clicks "back" you don't have to deal with the skipped screen in a 2nd place....
GalacTekM
09-23-2008, 11:02 AM
I have tried the Screen.Jump ("Finished Install") with no prevail as well as Screen.End
jassing
09-23-2008, 11:06 AM
I have tried the Screen.Jump ("Finished Install") with no prevail as well as Screen.End
why don't you post your code -- becuase "it works" isn't going to help you
GalacTekM
09-23-2008, 11:08 AM
if (nSelectedControl == CTRL_RADIO_BUTTON_02) then
Screen.Jump ("Finished Install")
else
Screen.Next ()
Im pretty sure this isnt correct, still trying to learn LUA. Thanks
jassing
09-23-2008, 11:20 AM
if (nSelectedControl == CTRL_RADIO_BUTTON_02) then
Screen.Jump ("Finished Install")
else
Screen.Next ()
Im pretty sure this isnt correct, still trying to learn LUA. Thanks
1st off -- where do you set nSelectedControl?
Style is a bit odd (to me) usually you have the parens next to the method
Screen.Next() instead of Screen.Next () but I don't think that's your problem...
Here's code that works -- provided that you you are using the "stock" finish screen ID (didnt change it) and the "stock" session var on a radiobutton screen.
You may need to change the code if you altered either...
The code goes in "On Next" of the radio button screen...
if String.ToNumber(SessionVar.Get("%RadioSelection%")) == CTRL_RADIO_BUTTON_02 then
Screen.Jump("Finished Install");
else
Screen.Next();
end
GalacTekM
09-23-2008, 12:50 PM
This also does not work. Seems to ignore the Screen.Jump action. No matter which radio is selected, it continues to the next screen.
jassing
09-23-2008, 12:54 PM
This also does not work. Seems to ignore the Screen.Jump action. No matter which radio is selected, it continues to the next screen.
you're doing something wrong..
post your project file.
GalacTekM
09-23-2008, 01:14 PM
File is attached in RAR format. Forum does not accept .sf8
jassing
09-23-2008, 01:21 PM
you cannot jump sections from pre-install to post-install
jassing
09-23-2008, 01:22 PM
not to mention you're issuing a screen.next before your if statement; so the if statement never gets executed...
GalacTekM
09-23-2008, 01:25 PM
I was able to get it to work with the following code:
if String.ToNumber(SessionVar.Get("%RadioSelection%")) == CTRL_RADIO_BUTTON_02 then
Screen.End ()
else
Screen.Next();
end
Problem was (which i stupidly did not realize) is that i had a Screen.Next variable before my if statement.
Thanks for you help.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.