1 Reply Latest reply on Jul 21, 2010 10:00 AM by Flex harUI

    <s:list bug? copying images with dragdrop fails

    USchmitt

      Hello Forumusers,

      i have transformed 2 perfect running drag-drop-examples from halo to spark. Both with the same bad behaviour (One of this you can see in this post).

       

      Moving or Copying Textelements from a Sourcelist to a Destinationlist is working fine in Flex4

       

      Moving Images is working fine, too

       

      Copying (this means dragging with the pressed Ctrl-Key) an Image  failed.

       

      My other example is using a dragdrop-function and shows the same behaviour.

       

      In the Destinationlist you add a thin line any time you try to copy. I think this is an empty element background.

       

      Could this be a bug in the spark list-component?

       

      Best regards

       

      Uwe

       

      Here is my sourcecode:

       

      <?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/mx" minWidth="955" minHeight="600">
         
         
          <fx:Declarations>
              <s:ArrayList id="srcList">
                  <mx:Image source="images/f1.jpg"/>
                  <mx:Image source="images/f2.jpg"/>
                  <mx:Image source="images/f3.jpg"/>
                  <mx:Image source="images/f4.jpg"/>
                  <mx:Image source="images/f5.jpg"/>
              </s:ArrayList>
             
              <s:ArrayList id="destList1">
                  <mx:Image source="images/f7.jpg"/>
              </s:ArrayList>   
                     
          </fx:Declarations>
         
          <fx:Script>
              <![CDATA[

       
                  import spark.skins.spark.DefaultComplexItemRenderer;
                  import spark.skins.spark.DefaultItemRenderer;
                 
                  private function rendererFunction(item:Object):ClassFactory
                  {
                      if(item is String)
                      {
                          return new ClassFactory(DefaultItemRenderer)
                      }
                      else
                      {
                          return new ClassFactory(DefaultComplexItemRenderer)
                      }
                  }
                 
              ]]>
          </fx:Script>
         
          <s:HGroup paddingLeft="10" paddingTop="10" height="547" width="426">
              <s:VGroup height="530">
                  <s:Label text="Alle Bilder" width="200" color="0x8F8F8F" textAlign="center"/>
                  <s:List dragEnabled="true"
                          dropEnabled="false"
                          dragMoveEnabled="true"
                          allowMultipleSelection="true"
                          itemRendererFunction="rendererFunction"
                          maxHeight="200" dataProvider="{srcList}" width="190" height="490">
                     
                  </s:List>
              </s:VGroup>
             
              <s:VGroup height="530">
                  <s:Label text="Bildauswahl" width="200" color="0x5010CC" textAlign="center"/>
                  <s:List dragEnabled="true"
                          dropEnabled="true"
                          dragMoveEnabled="true"
                          allowMultipleSelection="true"
                          itemRendererFunction="rendererFunction"
                          maxHeight="200" dataProvider="{destList1}" width="190" height="490">
                        
                  </s:List>
              </s:VGroup>
             
          </s:HGroup>
         
      </s:Application>