1 Reply Latest reply on Aug 13, 2008 2:59 PM by Newsgroup_User

    data binding?

    bizzw
      I am new to flex, so I might not be understanding what is really happening, but it appears that when I change a variable in a custom component it changes another variable in my application.

      What I am attempting to do is to have the user select a order number (myOrder) from a xml list.
      That selected order then is passed to a httpservice that receives samples in that order which are assigned to 3 sample arraycollections: "samples", "samplesView1", and "samplesView2".
      "samples" and "myOrder" are passed from my component to variables in my application ("newSamples", and "newMyOrder") in the complete event dispatched when the httpservice completes.
      "newSamples" is then assigned to my componetent's "samplesView1" which is put into a list (v2L1) and can be dragged and dropped into another list (v2L2) and bound to "mySamplesView1".
      And "newSamples" is also assigned to "samplesView2" which will similarly be put into a list (v3L1) and allowed to move into another list (v3L2) and bound to "mySamplesView2".
      So my goal would be to keep the "newSamples" arraycollection the same unless the order is changed...

      however when samples from "sampleView1" in v2L1 are moved to v2L2 the "newSamples" arraycollection changes along with it the "samplesView2" arraycollection. I am not really sure why this is happening because to my knowledge I am not binding anything in my component to anything in my application, but it seems to be changing in that way.
      I'm sure I'm just not understanding what is happening, so if someone could explain that to me that would be great.
        • 1. Re: data binding?
          Level 7

          "bizzw" <webforumsuser@macromedia.com> wrote in message
          news:g7vfou$7h7$1@forums.macromedia.com...
          >I am new to flex, so I might not be understanding what is really happening,
          >but
          > it appears that when I change a variable in a custom component it changes
          > another variable in my application.
          >
          >
          What I am attempting to do is to have the user select a order
          > number
          > (myOrder) from a xml list.

          >
          That selected order then is passed to a httpservice that receives
          > samples in that order which are assigned to 3 sample arraycollections:
          > "samples", "samplesView1", and "samplesView2".

          >
          "samples" and "myOrder" are passed from my component to variables
          > in
          > my application ("newSamples", and "newMyOrder") in the complete event
          > dispatched when the httpservice completes.

          >
          "newSamples" is then assigned to my componetent's "samplesView1"
          > which
          > is put into a list (v2L1) and can be dragged and dropped into another list
          > (v2L2) and bound to "mySamplesView1".

          >
          And "newSamples" is also assigned to "samplesView2" which will
          > similarly be put into a list (v3L1) and allowed to move into another list
          > (v3L2) and bound to "mySamplesView2".

          > So my goal would be to keep the "newSamples" arraycollection the same
          > unless
          > the order is changed...
          >
          > however when samples from "sampleView1" in v2L1 are moved to v2L2 the
          > "newSamples" arraycollection changes along with it the "samplesView2"
          > arraycollection. I am not really sure why this is happening because to my
          > knowledge I am not binding anything in my component to anything in my
          > application, but it seems to be changing in that way.
          > I'm sure I'm just not understanding what is happening, so if someone could
          > explain that to me that would be great.

          You have 6 variables that all point to exactly the same object
          (bv1.samples).

          HTH;

          Amy