View Full Version : Pass control back to button script from a listbox
Mango
02-27-2007, 07:14 PM
I have created a project where the majority of the script is executed from a button. Part way through the script, the user will be asked to make a single selection from a list box. So far this works fine, however, Is it possible to pass the chosen information back from the listbox to the button script, to carry on from where it left off. I'm trying to avoid having a duplicate script running from the On Select or On Double-click function of the list box.
Anyone have any ideas please?
Intrigued
02-27-2007, 09:55 PM
You could get the original script from the Button and then when the user interacts with the ListBox gather that information and then inject it into the Button's script, on the fly.
You can get and set the script for objects via the Action Page.GetObjectScript().
Are you sure this command works in the APMS5?
Mango
02-28-2007, 03:36 AM
Thanks for a quick response guys and thanks Intrigued, but it looks like Bule is right - AMSP5 doesn't seem to support that command - any other ideas?
Intrigued
02-28-2007, 06:56 AM
Sorry there... use to responding in the AMS 6 forum.
longedge
02-28-2007, 09:03 AM
I'd be thinking aong the lines of initially setting a variable and then re-assigning a value as a result of the selection. You can test whether the value has changed or not and use a while loop until it's changed - or whatever or is that not practicable.
Mango
02-28-2007, 11:07 AM
Hi Guys
Thanks for the responses, but I've now re-thought the project and decided to do away with the buttons altogether and run the script totally from the listbox. So far it seems to be working well.
Thanks again for your thoughts guys
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.