Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6935535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:06:56+00:00 2026-05-27T12:06:56+00:00

I am working on an existing project in Flex, and got tripped up for

  • 0

I am working on an existing project in Flex, and got tripped up for a day trying to figure out how data was getting from one list to another. I think I have figured it out but I’m hoping there are some Flex gurus out there that could shed some light on what is going on.

I’ll explain the situation:

There is a datasource lets call it ds, it loads an ArrayCollection (ac) into the model class (m). Then the view class (v) has two ListCollectionViews l1 and l2. Both l1 and l2 have filter functions so half the data get filtered out of l1 and the other half gets filtered out of l2.

Now this all makes sense so far, but if I add data to l1 or l2 it automagically gets added to m.ac. How is this happening? My best guess is that the underpinning data structure of all three lists is the same. But as I have spent so long stuck on this, I would love to know what is going on. Google has not been a lot of help on this one.

[More info]
As requested I’ll add some more details. Sorry I can’t copy and paste what I am working on.

inside model:

      [Bindable] public var ac:ArrayCollection     = null;

inside datasource:

    private function resultHandlerac (event:ResultEvent) : void {
        var ac:ArrayCollection = helperClass.arrayFromResultEvent (event); 
        m.ac = ac;
      }

inside view:

        [Bindable] public var l1:ListCollectionView;
        [Bindable] public var l2:ListCollectionView;

        private function resultHandlerac (ac:ArrayCollection) : void {

            week1Hours = new ListCollectionView(ac);
            week1Hours.filterFunction = function(i:Object) : Boolean { return i.WeekID 
            == 1 && !i.Removed; };

            week2Hours = new ListCollectionView(hoursData);
            week2Hours.filterFunction = function(i:Object) : Boolean { return i.WeekID 
            == 2 && !i.Removed; };

            l1.refresh();
            l2.refresh();
        }

And there is a data grid that displays l1 and l2, every time a feild gets edited, inside the data grid, the three lists update. If more info is required please let me know. I can’t put the real code up here as this is not an open source project I am working on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:06:57+00:00Added an answer on May 27, 2026 at 12:06 pm

    Your gut feeling is correct. ListCollectionView is just a wrapper around any IList that you give it as a source collection. It does not copy the items from the source collection.

    This leaves the source collection intact when you filter on it. For example:

    var ac:IList = new ArrayCollection([1, 2, 3]);
    
    var l1:ICollectionView = new ListCollectionView(ac);
    //filter out only item '1'
    l1.filterFunction = function(item:int):Boolean {return item == 1;}
    l1.refresh();
    
    var l2:ListCollectionView = new ListCollectionView(ac);
    //filter out all items but '1'
    l2.filterFunction = function(item:int):Boolean {return item != 1;}
    l2.refresh();
    
    trace(ac); //1,2,3
    trace(l1); //1
    trace(l2); //2,3
    

    Yet at the same time you can still add items to it as if it were the wrapped Ilist itself:

    l2.addItem(4);
    trace(ac); //1,2,3,4
    trace(l1); //1
    trace(l2); //2,3,4
    

    Just have a look at the source code of ListCollectionView and you’ll see what happens:

    public function addItemAt(item:Object, index:int):void
    {
        ...
        list.addItemAt(item, listIndex);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working on an existing project I suddenly got the following error when trying
I am working on existing project.Getting records something like this: $this->courses = Doctrine_Core::getTable('Course')->findByUserId($this->userId); Now
I've been trying to get an existing project working on local copy but have
I am working on existing Maven Project Which has got 5 modules like <modules>
I am working on an existing project, setup by another coder. I'm having some
I've just started working on an existing CakePHP project. I will be developing a
I am working on implementing Zend Framework within an existing project that has a
I'm working on a project where the client wants to have existing pages dynamically
I'm working on a project to convert an existing Java web application to use
I have been working with an existing website out company has running until I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.