19 Replies Latest reply on Aug 31, 2010 11:55 PM by Vikash.kumar29

    Flex 3.5 chained combobox problem

    rick@cat

      Hi Folks,

      I have 3 comboboxes that are linked together. When you select from the first one it fills the second one and then the third one.The problem is that once you make a selection to a different manufacturer, and then go back to the original manufacturer, the second and third comboboxes get out of sync. They still show the data from the first change that you made, not the new data selection. The problem started when i updated to SDK 3.5. Works fine using 3.4.

       

      Here's an example of the XML I'm using:

       

      <manufacturer equip_manufacturer_id="2" manufacturer_name="John Deere"/>
      <manufacturer equip_manufacturer_id="15" manufacturer_name="Komatsu">
          <equipment_type equip_type_id="11" equip_manufacturer_id="15" str_name="Farm Tractor">
              <equipment_model equip_model_id="919" equip_type_id="11" model_name="model 1"/>
              <equipment_model equip_model_id="918" equip_type_id="11" model_name="model 2"/>
              <equipment_model equip_model_id="921" equip_type_id="11" model_name="model 3"/>
          </equipment_type>
          <equipment_type equip_type_id="12" equip_manufacturer_id="15" str_name="Frontend Loader">
              <equipment_model equip_model_id="920" equip_type_id="12" model_name="model 1.1"/>
          </equipment_type>
      </manufacturer>

       

      And here's the MXML for the combo boxes. equipTypes is the variable for the xml from above.

       

      <mx:FormItem label="Equip MFG:">
          <mx:ComboBox id="equip_mfg_id"
              dataProvider="{equipTypes.elements('manufacturer')}"
              labelField="@manufacturer_name" width="250"/>
      </mx:FormItem>
      <mx:FormItem label="Equip Type:">
          <mx:ComboBox id="equip_type_id"
              dataProvider="{equip_mfg_id.selectedItem.elements('equipment_type')}"
              labelField="@str_name" width="250"/>
      </mx:FormItem>
      <mx:FormItem label="Model:">
          <mx:ComboBox id="model_id"
              dataProvider="{equip_type_id.selectedItem.elements('equipment_model')}"
              labelField="@model_name" width="250"/>
      </mx:FormItem>

       

      I've tried refreshing data on "change" of each combobox and no help. Again, this works fine in 3.4 but I need the advanceddatagrid so I updated to 3.5.

       

      Any ideas would be greatly appreciated,

      Rick

        • 1. Re: Flex 3.5 chained combobox problem
          Flex harUI Adobe Employee

          File a bug or post a small complete test case I can just copy/paste

          • 2. Re: Flex 3.5 chained combobox problem
            rick@cat Level 1

            I'd be happy to. Here's a working example:

             

             

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

                <mx:XML format="e4x" id="equipTypes">
                    <data>
                        <manufacturer equip_manufacturer_id="3" manufacturer_name="Case"/>
                        <manufacturer equip_manufacturer_id="1" manufacturer_name="Caterpillar">
                            <equipment_type equip_type_id="13" equip_manufacturer_id="1" str_name="Articulating Dump Truck">
                                <equipment_model equip_model_id="922" equip_type_id="13" model_name="725"/>
                            </equipment_type>
                            <equipment_type equip_type_id="3" equip_manufacturer_id="1" str_name="BACKHOE LOADER">
                                <equipment_model equip_model_id="132" equip_type_id="3" model_name="414E BACKHOE LOADER ELB"/>
                                <equipment_model equip_model_id="154" equip_type_id="3" model_name="416 BACKHOE LOADER 5PC"/>
                                <equipment_model equip_model_id="143" equip_type_id="3" model_name="416B BACKHOE LOADER 8SG"/>
                                <equipment_model equip_model_id="144" equip_type_id="3" model_name="416B BACKHOE LOADER 8ZK"/>
                                <equipment_model equip_model_id="155" equip_type_id="3" model_name="416C BACKHOE LOADER 1WR"/>
                            </equipment_type>
                            <equipment_type equip_type_id="5" equip_manufacturer_id="1" str_name="MOTOR GRADER">
                                <equipment_model equip_model_id="230" equip_type_id="5" model_name="11 AUTO PATROL 07K"/>
                                <equipment_model equip_model_id="229" equip_type_id="5" model_name="11 AUTO PATROL 08K"/>
                                <equipment_model equip_model_id="306" equip_type_id="5" model_name="12 MOTOR GRADER 71D"/>
                                <equipment_model equip_model_id="243" equip_type_id="5" model_name="120 MOTOR GRADER 10R"/>
                                <equipment_model equip_model_id="295" equip_type_id="5" model_name="120 MOTOR GRADER 22R"/>
                            </equipment_type>
                            <equipment_type equip_type_id="8" equip_manufacturer_id="1" str_name="ROAD RECLAIMER">
                                <equipment_model equip_model_id="779" equip_type_id="8" model_name="RM-250C RECLAIMER MIXER AWG"/>
                                <equipment_model equip_model_id="783" equip_type_id="8" model_name="RM-300 RECLAIMER MIXER BWR"/>
                                <equipment_model equip_model_id="782" equip_type_id="8" model_name="RM-350 RECLAIMER MIXER 5FK"/>
                                <equipment_model equip_model_id="781" equip_type_id="8" model_name="RM-350B RECLAIMER MIXER 7FS"/>
                                <equipment_model equip_model_id="786" equip_type_id="8" model_name="RM-350B ROAD RECLAIMER AXW"/>
                            </equipment_type>
                            <equipment_type equip_type_id="2" equip_manufacturer_id="1" str_name="TRACK-TYPE LOADER">
                                <equipment_model equip_model_id="4" equip_type_id="2" model_name="931 BACKHOE 32W"/>
                                <equipment_model equip_model_id="5" equip_type_id="2" model_name="931 BACKHOE 68H"/>
                                <equipment_model equip_model_id="6" equip_type_id="2" model_name="931 BACKHOE 87U"/>
                                <equipment_model equip_model_id="89" equip_type_id="2" model_name="931 TRACK LOADER 08N"/>
                                <equipment_model equip_model_id="101" equip_type_id="2" model_name="931 TRACK LOADER 10N"/>
                            </equipment_type>
                        </manufacturer>
                        <manufacturer equip_manufacturer_id="2" manufacturer_name="John Deere"/>
                        <manufacturer equip_manufacturer_id="15" manufacturer_name="Komatsu">
                            <equipment_type equip_type_id="11" equip_manufacturer_id="15" str_name="Farm Tractor">
                                <equipment_model equip_model_id="919" equip_type_id="11" model_name="Model 1"/>
                                <equipment_model equip_model_id="918" equip_type_id="11" model_name="Model 2"/>
                                <equipment_model equip_model_id="921" equip_type_id="11" model_name="Model 3"/>
                            </equipment_type>
                            <equipment_type equip_type_id="12" equip_manufacturer_id="15" str_name="Frontend Loader">
                                <equipment_model equip_model_id="920" equip_type_id="12" model_name="Model 1"/>
                            </equipment_type>
                        </manufacturer>
                    </data>
                </mx:XML>

                <mx:Canvas>
                    <mx:Form>
                        <mx:FormItem label="Equip MFG:">
                            <mx:ComboBox id="equip_mfg_id"
                                         dataProvider="{equipTypes.elements('manufacturer')}"
                                         labelField="@manufacturer_name" width="200"/>
                         </mx:FormItem>
                        <mx:FormItem label="Equip Type:">
                            <mx:ComboBox id="equip_type_id"
                                         dataProvider="{equip_mfg_id.selectedItem.elements('equipment_type')}"
                                          labelField="@str_name"
                                         width="200"/>
                        </mx:FormItem>
                        <mx:FormItem label="Equip Model:">
                            <mx:ComboBox id="equip_model_id"
                                         dataProvider="{equip_type_id.selectedItem.elements('equipment_model')}"
                                         labelField="@model_name"
                                         width="200"/>
                        </mx:FormItem>
                    </mx:Form>
                </mx:Canvas>
            </mx:Application>


            Thanks,

            Rick

            • 3. Re: Flex 3.5 chained combobox problem
              Flex harUI Adobe Employee

              I am unable to reproduce any problem using 3.5.  Maybe I need a more

              explicit set of steps?

              • 4. Re: Flex 3.5 chained combobox problem
                rick@cat Level 1

                Once loaded:

                 

                1. Select Caterpillar from first combo

                2. Look at list of equipment types

                3. Look at list of models

                 

                4. Select Komatsu

                5. Look at list of types:

                 

                You'll notice that the first item has changed and is correct but all other items in the Equip Type list are still related to Caterpillar, not Komatsu. The models combo does the same thing. Only the first item in the list matches correctly. All others have not been updated.

                 

                Basically, the second and third levels seem to get out of sync with the first combo selection. I've tried this in IE7 and Firefox 3.5.7 and both of them do the same thing. The SDK is the latest 3.5 stable version.

                 

                Thanks,

                Rick

                • 5. Re: Flex 3.5 chained combobox problem
                  Flex harUI Adobe Employee

                  I am using 3.5 that is packaged with Flex 4 prerelease and I don't have the

                  problem.  Maybe post the SWF.  Or create a new project using the test case

                  you posted.

                   

                  Trivia:  I have actually driven tractors from each of those companies except

                  John Deere (30 years ago)

                  • 6. Re: Flex 3.5 chained combobox problem
                    rick@cat Level 1

                    Alex,

                    Here's the swf.

                     

                    Yes, i drove them too 30 years ago, LOL!

                     

                    Thanks,

                    Rick

                    • 7. Re: Flex 3.5 chained combobox problem
                      rick@cat Level 1

                      Here's the whole project. I fixed the RSL to link to the right version of swf,swc in this one. Problem still exists.

                      Rick

                      • 8. Re: Flex 3.5 chained combobox problem
                        Flex harUI Adobe Employee

                        Your code still worked fine for me.

                        • 9. Re: Flex 3.5 chained combobox problem
                          rick@cat Level 1

                          Maybe Greg or one of the other guys could try it for us. For me, and my coworkers, it's very easy to recreate the problem.

                           

                          Any help would be appreciated on this...

                          Rick

                          • 10. Re: Flex 3.5 chained combobox problem
                            rick@cat Level 1

                            I made up a little flash screen capture so you can see what's happenning on my end. Please see attached.

                            • 11. Re: Flex 3.5 chained combobox problem
                              rick@cat Level 1

                              Alex,

                              Have you had a chance to look at the small video? I've been out for a few days and hoped someone would have tried this while I was gone.

                               

                              Also, I found another post that has the exact same issue with an earlier version: http://forums.adobe.com/message/2339743#2339743

                               

                              I don't mean to be a pain but need to get this resolved if possible.

                               

                              Thanks,

                              Rick

                              • 12. Re: Flex 3.5 chained combobox problem
                                Flex harUI Adobe Employee

                                If you are experiencing the problem in the other thread, it is now fixed in

                                my copies of the SDK (4.0 and 3.6).  You will need to use one of those

                                versions.

                                • 13. Re: Flex 3.5 chained combobox problem
                                  davtwix

                                  Hi,

                                   

                                  I just report this bug here : https://bugs.adobe.com/jira/browse/SDK-25705

                                   

                                  In 3.4.0 it's ok but not in 3.5.0 ?!?

                                   

                                  hope the next version will fix it

                                   

                                  I prefer waiting for 3.6 in stable state to use it

                                   

                                  regards

                                  • 14. Re: Flex 3.5 chained combobox problem
                                    danny_beard

                                    I found this forum post since I was having the same issue. I can verify that using the latest 3.6.0 build fixed the problem, but definitely would feel more comfortable using a production release. Did you ever find any workarounds?

                                    • 15. Re: Flex 3.5 chained combobox problem
                                      davtwix Level 1

                                      Unfortunately not and I also prefer use release version instead of Nighty Build

                                       

                                      With the approach of the next version 4, I'm afraid Adobe don't maintained there efforts on the 3.x branchs

                                       

                                      Hope I'm wrong

                                      • 16. Re: Flex 3.5 chained combobox problem
                                        rick@cat Level 1

                                        FYI,

                                        I ended up using 3.6 and it did fix the problem. Been using it now for a few weeks and it seems to work fine. I'm using SDK 3.6.0.13443

                                        Rick

                                        • 17. Re: Flex 3.5 chained combobox problem
                                          justuspost

                                          I just used the latest 3.6.0.16736 build and it also corrected this same problem. I'm pretty sure it's a known bug, but when will they give us a production release build of 3.6?

                                          • 18. Re: Flex 3.5 chained combobox problem
                                            Flex harUI Adobe Employee

                                            Yes, it is a known bug.  There isn't a public date for 3.6 release yet,

                                            which means it isn't soon, but I have been told it will happen.

                                            • 19. Re: Flex 3.5 chained combobox problem
                                              Vikash.kumar29 Level 3

                                              In Flex Sdk 3.5. I am able to fix this issue by extending Combobox. Please follow the following code.:

                                              package com.customcontrols
                                              {
                                                   import mx.controls.ComboBox;
                                                   import mx.core.mx_internal;
                                              
                                                   use namespace mx_internal;
                                                   public class ExtendedComboBox extends ComboBox
                                                   {
                                                        private var isDataProviderChanged:Boolean;
                                              
                                                        public function ExtendedComboBox()
                                                     {
                                                        super();
                                                     }
                                              
                                                        override public function set dataProvider(value:Object):void
                                                     {
                                                        super.dataProvider = value;
                                                        isDataProviderChanged = true;
                                                        }
                                              
                                                        override mx_internal function hasDropdown():Boolean
                                                     {
                                                        if(isDataProviderChanged)
                                                        {
                                                                 isDataProviderChanged = false;
                                                             return false; 
                                                        }
                                                        return super.hasDropdown();
                                                     }
                                                   }
                                              }
                                              

                                               

                                              Hopes this helps you.

                                               

                                              Regards

                                              -Vikash