2 Replies Latest reply on Jun 27, 2008 6:20 AM by Rhuno

    Flex List Control Help

    Rhuno Level 1
      First off, hello! I just (like yesterday) downloaded the Flex trial and started messing around. The first thing I wanted to make was a small file upload utility which I did...but there is a bug I cannot resolve. It involves the List control. In my app, you drag files from the desktop onto a list control which then displays all the file names you want to upload.

      Everything works fine unless you drag enough files onto the list control to make it scroll. Once you start scrolling it looks like the data just gets borked and I see the same file name repeated several times and other file names seem to disappear. I was hoping someone could take a look at the code below and see if they can spot the problem. Please keep in mind this is my first experiment with Flex and I'm not entirely sure I'm using the control and dataprovider stuff correctly!

        • 1. Re: Flex List Control Help
          ntsiii Level 3
          I do not do AIR yet, but I do know that the low-level array methods, like "push" do not dispatch the necessary events to correctly update the UI.

          You need to use an ArrayCollection for the List.dataProvider, not Array, and use the ArrayCollection API to manage the updates. (addItem(), etc.)

          • 2. Re: Flex List Control Help
            Rhuno Level 1
            Hey, that worked! Just changed the array to an arraycollection and modified the code a little bit to accommodate the new type and everything is fine now. Thanks!