issues with drag and drop

I have two different Spark Lists , with two different ItemRenderers , one of them with dragEnabled="true" and the other with dropEnabled="true" , in such a way that whenever I drag from one and drop in the other, a copy of the object dropped is created and inserted in the second List's dataProvider.

<s:List id="source"
        itemRenderer="componentsRenderers.SourceItemRenderer"
        dragEnabled="true"
        dataProvider="{elements}"/>

<s:List id="destination"
        itemRenderer="componentsRenderers.DestinationItemRenderer"
        dragEnabled="false"
        dropEnabled="true"
        change="destinationChanged(event)"/>

The event handler destinationChanged() is a method that parses the recently added object, removes it, and creates a new one that, among other stuff, has an UIComponent that has to be rendered.

The hole thing works well, except by one thing: as soon as the I load the application, the UIComponent of the first item to be dropped in destination never gets renderer. The full object is there and all the other functionalities related to it work, but the component doesn't get rendered. If I delete the object, making the List empty again, and insert it again, it gets rendered!

Also, after inserting the 'invisible' one, all the following inserts works.

Ideas? Thanks!


Update: I just found out that the itemRenderer DestinationItemRenderer gets rendered twice for the first element to be dropped.

链接地址: http://www.djcxy.com/p/34614.html

上一篇: Flex 4火花列表宽度调整大小问题

下一篇: 拖放问题