2 Replies Latest reply on Apr 5, 2007 9:19 AM by craigkaminsky

    ComboBox - inconsistent Item Selection Across Users

    craigkaminsky Level 3
      I have a Flex event management application I am wrapping up but, in my testing, noticed an odd issue that I'm not even sure how to go about checking out.

      Issue: One two separate screens of the application our users search for and select an individual or organization to manage (i.e., edit their contact information or event registration details) . When the user is selected (from a Data Grid), a form is populated with their data. Nothing big there. However, I have two Combo Boxes on the forms for State and Country.

      On all the machines I've tested on, when you select the user, the Combo Box displays his/her correct state and country. One of my other testers, when selecting an individual or organization, sees the prompts (Select Country, Select State) in the Combo Box and not the correct state/country.

      The correct state and country are displayed with the following:
      <mx:ComboBox id="ORGANIZATION_State" dataProvider="{acStates}" labelField="name" prompt="{dgOrganizations.selectedItem.ORGANIZATION_State}"/>

      Both testers (myself and my associate) use the current version of the Flash Player (9.*). I've tried in Firefox 1.5 (PC), Firefox 2 (PC), IE 6 , IE 7, Firefox 2 (Mac), Camino 1.1 Beta, Safari 2, and Opera 9 (both Mac and PC). He's tried in IE 7 and Firefox 2 (PC). Once again, it works perfectly for me but he gets the problem.

      Thanks, so much, for any assistance or thoughts on this!
        • 1. Re: ComboBox - inconsistent Item Selection Across Users
          ntsiii Level 3
          I am not sure that is a valid use of prompt. Clever, but it makes me nervous, because it is only displaying the value, it has not navigated the combo box to the correct item, so the combo.selectedItem will not return the correct object.

          Normal practice is to actually select the correct itme, by setting selectedItem(which requires a reference into the dataProvider item), or by looping over the dataProvider items till a match, then setting selectedIndex.

          Have you seen anyone else use prompt as you are?

          • 2. Re: ComboBox - inconsistent Item Selection Across Users
            craigkaminsky Level 3
            Thanks, Tracy.

            I did find this use of the prompt online. Of course now, even with Google Search History enabled, I can't find the resource!

            I'll look into looping over the dataProvider and setting the selectedIndex. Stupid question for this approach (sorry): what is the best way to go about this?

            Should I call a function when the data is returned from the DB/server, loop over the Array/ArrayCollection and then apply the selectedIndex to the ComboBox? This seems like the way I should do it but just wanted to ask.

            Thanks, again,