1 Reply Latest reply on Mar 16, 2010 8:57 AM by Flex harUI

    Really wierd Combo Box problem (with example)

    PeteSmithUK Level 1

      Hi all.

       

      I've got a customised combobox that I'm using as a context bar. The bar is effectively a long line of combo boxes to give our application a context (from within a hierarchy of data). It works by the user selecting the first entry from the drop down. This creates a child (from the 2nd level of cached data within the 1st button). The child's menu then opens automatically while a request goes off to the server to fill in more of the object graph.

       

      A bug's been raised on our system because occasionally, the context bar will pop up a menu with what's been called "comedy fonts", i.e. the menu is created where a single line of text, say "This is a long line" will fill the entire width of a 1280*1024 screen. This *only* happens when the combo box menu is opened automatically. Manually opening the menu never causes the problem. In addition to the "comedy fonts" menu, the normal menu is also present, sometimes in front, but mostly behind the large menu.

       

      When it occurs, it's almost always when the user has traversed most of the graph, the container that the context bar is in too small, and the scroll bar is present (and has auto-scrolled to the far right).

       

      I've been looking in my code, and thought I'd try an experiment: Create a normal combo box, put it within a title window, and have the title window too small for the popup menu. When the application creation complete method fires, the app runs the combo box .open method.

       

      In Flex 4 Beta 2 (public release, not nightly), this always results in the problem I've described above.

       

      In Flex 3.4, it never occurs.

       

      The source is below...

       

      <?xml version = "1.0" encoding = "utf-8"?>
      <s:Application xmlns:fx = "http://ns.adobe.com/mxml/2009"
                     xmlns:s = "library://ns.adobe.com/flex/spark"
                     xmlns:mx = "library://ns.adobe.com/flex/halo"
                     minWidth = "1024"
                     minHeight = "768"
                     creationComplete = "init();">
          <fx:Script>
              <![CDATA[
                  import mx.events.FlexEvent;
                  private function init():void
                  {
                      combo.open();
                  }
              ]]>
          </fx:Script>

       

          <mx:TitleWindow width = "100"
                          height = "100">
              <mx:ComboBox id = "combo">
                  <s:ArrayCollection>
                      <fx:Object label = "Item 1"/>
                      <fx:Object label = "Item 2"/>
                      <fx:Object label = "Item 3"/>
                      <fx:Object label = "This is an extra long label name"/>
                  </s:ArrayCollection>
              </mx:ComboBox>
          </mx:TitleWindow>
      </s:Application>

       

      An example is here. This is scaled down from 1280x1024, displayed in Firefox (to give you a sense of scale).

      ComedyFont.jpg

       

      If anyone has any ideas, I'd greatly appreciate it.

       

      Thanks.

       

      Pete.