9 Replies Latest reply on Feb 22, 2010 2:07 PM by Sam Souhrada

    ItemRenderer Issue with more than one item - locks up flex application

    Sam Souhrada

      I'm having a unique error in Adobe Flex when using item renderers. The example below shows a combobox with a very simple item renderer:

       

      <mx:ComboBox id="stateOfResidence" y="80" width="325" fontFamily="Arial" fillAlphas="[1.0, 1.0]" fillColors="[#8DACE3, #8DACE3]" borderColor="#959595"  themeColor="#8DACE3" fontSize="13" color="#FFFFFF" tabEnabled="true" tabIndex="3" tabChildren="true">
                                  <mx:itemRenderer>
                                  <mx:Component>
                                      <mx:Canvas width="50" height="50" backgroundColor="#FF0000">
                                             
                                      </mx:Canvas>
                                  </mx:Component>
                              </mx:itemRenderer>

       

      Basically just a red canvas which displays like this:

       

      simpleRenderer.JPG

       

      If I add anything to the renderer the ComboBox doesn't open at all and various parts of the application stop working. Here is the code for the item renderer:

       

      <mx:ComboBox id="stateOfResidence" y="80" width="325" fontFamily="Arial" fillAlphas="[1.0, 1.0]" fillColors="[#8DACE3, #8DACE3]" borderColor="#959595"  themeColor="#8DACE3" fontSize="13" color="#FFFFFF" tabEnabled="true" tabIndex="3" tabChildren="true">
                                  <mx:itemRenderer>
                                  <mx:Component>
                                      <mx:Canvas width="50" height="50" backgroundColor="#FF0000">
                                          <mx:Label paddingLeft="5" text="TEST!"/>   
                                      </mx:Canvas>
                                  </mx:Component>
                              </mx:itemRenderer>                           
                              </mx:ComboBox>

       

      Here is a screenshot:

       

      twoItemRenderer.JPG

       

      The text is grayed out and the box doesn't open. Additionally all other comboboxes stop operating correctly.

       

       

      Attached is a sample project that I've attempted to show how the main application is wired up. However... in my example everything is working.

       

       

      *Any ideas as to why I can't put a more complex item renderer in my application?

       

      *Has anyone come across an issue like this before?

       

       

      Thanks