ComboBox problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • andrewr
    Forum Member
    • May 2005
    • 16

    ComboBox problem

    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.
    Last edited by andrewr; 05-04-2005, 03:14 PM.
  • TJ_Tigger
    Indigo Rose Customer
    • Sep 2002
    • 3159

    #2
    Can you post a copy of your function? Might help in troubleshooting.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment

    • andrewr
      Forum Member
      • May 2005
      • 16

      #3
      The code can really be anything. Here, I just set this up and ran it:

      Open a page, insert a ComboBox. Change the properties to "Dropdown Edit". I noticed that the problem does NOT occur if the ComboBox remains "Dropdown List". Now add some default variables, say '1', '2', '3'. Now open the page properties and in the On Preload action section add the following function:
      --
      function MyFunc()
      Dialog.Message("",ComboBox.GetText("ComboBox"),MB_ OK);
      end
      --

      Now open the properties for the ComboBox and in the On Select action section add:
      --
      MyFunc();
      --

      now build and run and change the combobox selection.

      Comment

      • JimS
        Indigo Rose Customer
        • May 2003
        • 1057

        #4
        Is combo box data (selection) loaded during page preload? Try it on ‘On Show’

        Comment

        • andrewr
          Forum Member
          • May 2005
          • 16

          #5
          Negative, that did not fix it. I tried it out, but it doesn't seem to matter where the function definition is located. Again, the problem only happens if the ComboBox is editable. If it's a simple dropdown list it works fine, which is the odd part. The only workaround that I have is to add a button the user has to press to retrieve the data. Not having that button is strongly desired.

          Comment

          • andrewr
            Forum Member
            • May 2005
            • 16

            #6
            Ok, I just submitted a ticket, but just for you curious folks, I'm attaching a sample of what I'm talking about.
            Attached Files

            Comment

            Working...
            X