4 Replies Latest reply on Nov 19, 2008 8:34 PM by flexman5000

    combo box error

    cr1s
      Hello,
      I am very new to Flex and have a question I hope someone can help me with.
      My application was built using the ColdFusion Flex application wizard. The application uses MSSQL server with Coldfusion.

      It seems that I am required to select an item from a comboBox even if the item I want is already being displayed. You must select an entry from the combo box by iether reselecting the item currently displayed or selecting one of the other options

      If I do not make a selection from the combo box I am returned with an error even if the item I want is already displayed.

      i(mx.rpc::Fault)#0
      errorID = 0
      faultCode = "Server.Processing"
      faultDetail = "[Macromedia][SQLServer JDBC Driver][SQLServer]The INSERT statement conflicted with the FOREIGN KEY constraint

      If you open the combo box and make a selection everything woks well.

      Can I have it so that if the item I want from the combo box is already displayed, it will accept that result without having to reselect the item from the combo box?

      Thanks in advance for your help.
        • 1. Re: combo box error
          m_hartnett Level 3
          I believe that what you want is a value aware combo box. In flex you need to do a little work to get this done but it is preaty easy once you understand it. Read this link ... it does a good job of explaining.

          http://flex.sys-con.com/node/312098
          • 2. Re: combo box error
            cr1s Level 1
            Thanks for your response.

            I believe you are correct in that a value aware combo box would solve my problem.
            The code in accomplshing this is over my head so I think I will retain someone to do it for me.

            Thanks again for your response.
            • 3. Re: combo box error
              ntsiii Level 3
              Actually, doing this in a "one-off" situation is quite easy.

              Say you have a value you want to set the Combo box to. You loop over the comboBox dataProvider and compare your value to the values in the appropriate property of each dataProvider item. If there is a match, you use the loop index to set the ComboBoxes selectedIndex.

              The examples you will see are more complex because they try to do this generically. You know which item property has yur value so you can just compare it.

              Post your ComboBox and dataProvider and I'll help.

              Tracy
              • 4. Re: combo box error
                flexman5000
                Here is a value aware combobox created by Dennis Miller
                Link to the site

                I hope this helps
                Cheers