I'm making my first autorun program and I have a question.
I have a function, let's call it MyFunc(), that is defined in the On Preload section of a page. On that page I have a combobox that I filled with items in On Show. MyFunc() is called each time an item is selected (using On Select). MyFunc() just takes the data from the combobox (using GetText) displays it on the screen.
The problem I'm having is in regards to the order of operations that is taken. Whenever I select an item, the e_Selection variable in On Select is correct, but when MyFunc() is called, the value retrieved by GetText is NOT correct, it's actually the old value.
For example, say the combobox held three things, "A", "B", and "C". Let's say MyFunc takes the "current" value (GetText) and just displays it to the screen. If "A" is selected first, nothing displays. Then if "B" is selected, "A" is displayed. Next, if "C" is selected, "B" is displayed. It seems that GetText retrieves the old value.
From what I can tell, the On Select section is executed before the ComboBox data is refreshed on the screen, which would be what GetText retrieves. I don't know why it would be implemented this way, might be a good idea to change it for next time.
Just as I was typing this, I noticed the function GetItemText, which I can use as a workaround. There'll just be another variable to keep track of, great.
Scratch that, GetItemText won't work, since I also want to allow the user to input data and there will be no way to get the text entered in the On Key section (I want to wait until they hit Enter). So for now I have a button that you have to push to Search. Bummer.
I have a function, let's call it MyFunc(), that is defined in the On Preload section of a page. On that page I have a combobox that I filled with items in On Show. MyFunc() is called each time an item is selected (using On Select). MyFunc() just takes the data from the combobox (using GetText) displays it on the screen.
The problem I'm having is in regards to the order of operations that is taken. Whenever I select an item, the e_Selection variable in On Select is correct, but when MyFunc() is called, the value retrieved by GetText is NOT correct, it's actually the old value.
For example, say the combobox held three things, "A", "B", and "C". Let's say MyFunc takes the "current" value (GetText) and just displays it to the screen. If "A" is selected first, nothing displays. Then if "B" is selected, "A" is displayed. Next, if "C" is selected, "B" is displayed. It seems that GetText retrieves the old value.
From what I can tell, the On Select section is executed before the ComboBox data is refreshed on the screen, which would be what GetText retrieves. I don't know why it would be implemented this way, might be a good idea to change it for next time.
Just as I was typing this, I noticed the function GetItemText, which I can use as a workaround. There'll just be another variable to keep track of, great.
Scratch that, GetItemText won't work, since I also want to allow the user to input data and there will be no way to get the text entered in the On Key section (I want to wait until they hit Enter). So for now I have a button that you have to push to Search. Bummer.
Comment