5 Replies Latest reply on Jan 8, 2007 9:17 AM by FlightGuy

    blank Items in combo / list !?

      I'm using a static Xml file as dataprovider for a combobox

      <mx:XML format="e4x" source="Currencies.xml" id="currencyModel" xmlns=""></mx:XML>
      <mx:ComboBox dataProvider="{currencyModel.currency.cushort}" id="srcCurrency" ></mx:ComboBox>

      When displaying the combobox some items appear blank, but if i select one of the blank, the value is shown in the box.
      The blank items change if i reopen the combobox and other items are blank.
      I've got the same problem with a list and a xml as dataprovider.

      This is very strange and i have no idea to solve this problem.

      Does anyone have an idea about this?


        • 1. Re: blank Items in combo / list !?
          ntsiii Level 3
          Try setting the labelField property.
          • 2. Re: blank Items in combo / list !?
            FlightGuy Level 1
            I think I may have seen this before. Any chance you've set the font size larger without increasing the rowHeight on the dropDownList?

            I had a similar problem and this is (more or less) what I did. Try it and if you can't make it work I'll dig out the code wrote.

            Create a ClassFactory for a list:

            private function get listClassFactory():ClassFactory{
            var listFactory:ClassFactory = new ClassFactory(List);
            listFactory.properties = {rowHeight: 30}; // Or something - just try a big number first
            return listFactory;

            Then for your comboBox, do this:
            <mx:ComboBox dropdownFactory="{listClassFactory}" .../>

            Now you should get taller rows in the dropdown and I think that'll get rid of your problem.

            My recollection is that this happens when the fist item in the list is intentionally blank - I think the list uses the height of the first item to set the rowHeight.

            • 3. Re: blank Items in combo / list !?
              FlightGuy Level 1
              Wouldn't it be nice if the constructor for ClassFactory could take both the generator class and the properties object in its constructor. Then you could just use it inline:

              <mx:ComboBox dropdownFactory="{new ClassFactory(List, {rowHeight:30})}" .../>

              By the way, don't forget to import List and ClassFactory.

              • 4. Re: blank Items in combo / list !?
                <MarianDe> Level 1
                Hi, thanx for your posts. unfortunately no hint worked for me.
                I tricked it out for my self and i've got a strange solution.
                Now i use a labelRenderer which does nothing else than put a whitespace before the label. And it works!!!

                <mx:List id="siteList" click="siteSelected(siteList.selectedItem)" labelFunction="myLaRend" fontSize="9" width="96%" height="96%" x="11" y="10"></mx:List>

                and the renderfunction:

                public function myLaRend(item:Object):String
                return " " + item;


                • 5. Re: blank Items in combo / list !?
                  FlightGuy Level 1
                  Strange - I'd be interested in seeing the content of your siteList and experimenting a bit with it. Does the list have a blank item in it?