2 Replies Latest reply on Oct 2, 2008 11:32 AM by dpark1113

    Assigning single event.result to multiple arraycollections

    dpark1113 Level 1
      Hi,
      I'm calling a remoteobject and assign event.result to multiple arraycollections.

      public function test1(event:ResultEvent):void
      {
      arc1 = event.result as ArrayCollection;
      arc2 = event.result as ArrayCollection;
      arc3 = event.result as ArrayCollection;
      }

      The problem with this is when I use filterfunction for arc1, it affects arc2 and arc3 as well. I know this because I have three datagrids, each assign to arc1, arc2, and arc3. All datagrids changes when I filter arc1 dataprovider using filterfunction.
      Can someone knows why this is happening?
        • 1. Re: Assigning single event.result to multiple arraycollections
          Level 7

          "dpark1113" <webforumsuser@macromedia.com> wrote in message
          news:gc0r59$ldp$1@forums.macromedia.com...
          > Hi,
          > I'm calling a remoteobject and assign event.result to multiple
          > arraycollections.
          >
          > public function test1(event:ResultEvent):void
          > {
          > arc1 = event.result as ArrayCollection;
          > arc2 = event.result as ArrayCollection;
          > arc3 = event.result as ArrayCollection;
          > }
          >
          > The problem with this is when I use filterfunction for arc1, it affects
          > arc2
          > and arc3 as well. I know this because I have three datagrids, each assign
          > to
          > arc1, arc2, and arc3. All datagrids changes when I filter arc1
          > dataprovider
          > using filterfunction.
          > Can someone knows why this is happening?

          Either set arc2.source , arc3.source = arc1.source or use ListCollectionView
          instead of ArrayCollection.

          HTH;

          Amy


          • 2. Re: Assigning single event.result to multiple arraycollections
            dpark1113 Level 1
            Thank you Amy! I'll try .source method.