Loading ...
Sorry, an error occurred while loading the content.

Re: Drag and Drop question

Expand Messages
  • Rafael Faria
    I wouldn t say voodoo but if you drag an item from tree 1 to tree 2 the dataprovider should not contain the item you ve dragged to the other tree... am i
    Message 1 of 22 , May 1, 2008
    • 0 Attachment
      I wouldn't say "voodoo" but if you drag an item from tree 1 to tree 2
      the dataprovider should not contain the item you've dragged to the
      other tree... am i wrong?

      rafael


      --- In flexcoders@yahoogroups.com, "Josh McDonald" <dznuts@...> wrote:
      >
      > I'm fairly certain that there's no voodoo to automatically delete
      nodes from
      > your XML, you need to do that yourself in your drop handler.
      >
      > -J
      >
      > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@...>
      > wrote:
      >
      > > If i'm dragging an element from one tree to another. How do i
      get the
      > > updated xml of the tree i'm dragging off?
      > >
      > > For instance
      > >
      > > TREE 1
      > > - Element 1
      > > - Element 2
      > >
      > > TREE 2
      > >
      > > if i get the xml from tree 1 it would be something like
      > > <root>
      > > <element label="Element 1" />
      > > <element label="Element 2" />
      > > </root>
      > >
      > > but if i drag the Element 1 into the TREE 2 i want to get the xml
      > > without the "Element 1", without that node.
      > >
      > > i'm trying to get it creating a handler for "dragDrop" attribute on
      > > the Tree 2, but everytime i get it the items are not updated.
      > >
      > > Anyone know how to get the updated xml that tree 1 will have after i
      > > drop the element?
      > >
      > > Please... this is killing me =/
      > >
      > > Thanks
      > >
      > >
      > >
      >
      >
      >
      > --
      > "Therefore, send not to know For whom the bell tolls. It tolls for
      thee."
      >
      > :: Josh 'G-Funk' McDonald
      > :: 0437 221 380 :: josh@...
      >
    • Rafael Faria
      If im moving the object i would assume it will not be in the tree 1 anymore... anyone would help me how do i drag from tree 1, drop on tree 2 and after i drop
      Message 2 of 22 , May 1, 2008
      • 0 Attachment
        If im moving the object i would assume it will not be in the tree 1
        anymore...

        anyone would help me how do i drag from tree 1, drop on tree 2 and
        after i drop i get the elements on tree 1 without the one i just
        dropped on tree 2?

        should this be that painfull? do i have to delete manually?!

        Thanks

        --- In flexcoders@yahoogroups.com, "Rafael Faria"
        <rafaelfaria.grupos@...> wrote:
        >
        > I wouldn't say "voodoo" but if you drag an item from tree 1 to tree 2
        > the dataprovider should not contain the item you've dragged to the
        > other tree... am i wrong?
        >
        > rafael
        >
        >
        > --- In flexcoders@yahoogroups.com, "Josh McDonald" <dznuts@> wrote:
        > >
        > > I'm fairly certain that there's no voodoo to automatically delete
        > nodes from
        > > your XML, you need to do that yourself in your drop handler.
        > >
        > > -J
        > >
        > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@>
        > > wrote:
        > >
        > > > If i'm dragging an element from one tree to another. How do i
        > get the
        > > > updated xml of the tree i'm dragging off?
        > > >
        > > > For instance
        > > >
        > > > TREE 1
        > > > - Element 1
        > > > - Element 2
        > > >
        > > > TREE 2
        > > >
        > > > if i get the xml from tree 1 it would be something like
        > > > <root>
        > > > <element label="Element 1" />
        > > > <element label="Element 2" />
        > > > </root>
        > > >
        > > > but if i drag the Element 1 into the TREE 2 i want to get the xml
        > > > without the "Element 1", without that node.
        > > >
        > > > i'm trying to get it creating a handler for "dragDrop" attribute on
        > > > the Tree 2, but everytime i get it the items are not updated.
        > > >
        > > > Anyone know how to get the updated xml that tree 1 will have after i
        > > > drop the element?
        > > >
        > > > Please... this is killing me =/
        > > >
        > > > Thanks
        > > >
        > > >
        > > >
        > >
        > >
        > >
        > > --
        > > "Therefore, send not to know For whom the bell tolls. It tolls for
        > thee."
        > >
        > > :: Josh 'G-Funk' McDonald
        > > :: 0437 221 380 :: josh@
        > >
        >
      • Josh McDonald
        It makes sense to me that you would. Drag and drop is a visual operation, not a data operation, and in no way does it always mean that you re removing
        Message 3 of 22 , May 1, 2008
        • 0 Attachment
          It makes sense to me that you would. Drag and drop is a visual operation, not a data operation, and in no way does it always mean that you're removing something from the first list. For an example think of the "components" palette in Builder. There might be some way to enable the sort of automatic behavior you're talking about, but I doubt it. Drag and drop isn't just for components bound to an array / IList - you can use it with any component you like.

          -J

          On Thu, May 1, 2008 at 5:24 PM, Rafael Faria <rafaelfaria.grupos@...> wrote:

          If im moving the object i would assume it will not be in the tree 1
          anymore...

          anyone would help me how do i drag from tree 1, drop on tree 2 and
          after i drop i get the elements on tree 1 without the one i just
          dropped on tree 2?

          should this be that painfull? do i have to delete manually?!

          Thanks

          --- In flexcoders@yahoogroups.com, "Rafael Faria"


          <rafaelfaria.grupos@...> wrote:
          >
          > I wouldn't say "voodoo" but if you drag an item from tree 1 to tree 2
          > the dataprovider should not contain the item you've dragged to the
          > other tree... am i wrong?
          >
          > rafael
          >
          >
          > --- In flexcoders@yahoogroups.com, "Josh McDonald" <dznuts@> wrote:
          > >
          > > I'm fairly certain that there's no voodoo to automatically delete
          > nodes from
          > > your XML, you need to do that yourself in your drop handler.
          > >
          > > -J
          > >
          > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@>
          > > wrote:
          > >
          > > > If i'm dragging an element from one tree to another. How do i
          > get the
          > > > updated xml of the tree i'm dragging off?
          > > >
          > > > For instance
          > > >
          > > > TREE 1
          > > > - Element 1
          > > > - Element 2
          > > >
          > > > TREE 2
          > > >
          > > > if i get the xml from tree 1 it would be something like
          > > > <root>
          > > > <element label="Element 1" />
          > > > <element label="Element 2" />
          > > > </root>
          > > >
          > > > but if i drag the Element 1 into the TREE 2 i want to get the xml
          > > > without the "Element 1", without that node.
          > > >
          > > > i'm trying to get it creating a handler for "dragDrop" attribute on
          > > > the Tree 2, but everytime i get it the items are not updated.
          > > >
          > > > Anyone know how to get the updated xml that tree 1 will have after i
          > > > drop the element?
          > > >
          > > > Please... this is killing me =/
          > > >
          > > > Thanks
          > > >
          > > >
          > > >
          > >
          > >
          > >
          > > --
          > > "Therefore, send not to know For whom the bell tolls. It tolls for
          > thee."
          > >
          > > :: Josh 'G-Funk' McDonald
          > > :: 0437 221 380 :: josh@
          > >
          >




          --
          "Therefore, send not to know For whom the bell tolls. It tolls for thee."

          :: Josh 'G-Funk' McDonald
          :: 0437 221 380 :: josh@...
        • Tracy Spratt
          Actually I am pretty sure the list-based component s built-in drag/drop functionality does do this on a MOVE. The docs describe this. Are the XML structures
          Message 4 of 22 , May 1, 2008
          • 0 Attachment

            Actually I am pretty sure the list-based component’s built-in drag/drop functionality does do this on a MOVE.  The docs describe this.  Are the XML structures the same?

             

            Tracy

             


            From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com ] On Behalf Of Josh McDonald
            Sent: Thursday, May 01, 2008 2:46 AM
            To: flexcoders@yahoogroups.com
            Subject: Re: [flexcoders] Drag and Drop question

             

            I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler.

            -J

            On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria. grupos@gmail. com> wrote:

            If i'm dragging an element from one tree to another. How do i get the
            updated xml of the tree i'm dragging off?

            For instance

            TREE 1
            - Element 1
            - Element 2

            TREE 2

            if i get the xml from tree 1 it would be something like
            <root>
            <element label="Element 1" />
            <element label="Element 2" />
            </root>

            but if i drag the Element 1 into the TREE 2 i want to get the xml
            without the "Element 1", without that node.

            i'm trying to get it creating a handler for "dragDrop" attribute on
            the Tree 2, but everytime i get it the items are not updated.

            Anyone know how to get the updated xml that tree 1 will have after i
            drop the element?

            Please... this is killing me =/

            Thanks




            --
            "Therefore, send not to know For whom the bell tolls. It tolls for thee."

            :: Josh 'G-Funk' McDonald
            :: 0437 221 380 :: josh@gfunk007. com

          • Josh McDonald
            How do you mark a drag/drop operation as having a certain type (ie Move)? -J ... -- Therefore, send not to know For whom the bell tolls. It tolls for thee.
            Message 5 of 22 , May 1, 2008
            • 0 Attachment
              How do you mark a drag/drop operation as having a certain type (ie Move)?

              -J

              On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@...> wrote:

              Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE.  The docs describe this.  Are the XML structures the same?

               

              Tracy

               


              From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald
              Sent: Thursday, May 01, 2008 2:46 AM
              To: flexcoders@yahoogroups.com
              Subject: Re: [flexcoders] Drag and Drop question

               

              I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler.

              -J

              On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@...> wrote:

              If i'm dragging an element from one tree to another. How do i get the
              updated xml of the tree i'm dragging off?

              For instance

              TREE 1
              - Element 1
              - Element 2

              TREE 2

              if i get the xml from tree 1 it would be something like
              <root>
              <element label="Element 1" />
              <element label="Element 2" />
              </root>

              but if i drag the Element 1 into the TREE 2 i want to get the xml
              without the "Element 1", without that node.

              i'm trying to get it creating a handler for "dragDrop" attribute on
              the Tree 2, but everytime i get it the items are not updated.

              Anyone know how to get the updated xml that tree 1 will have after i
              drop the element?

              Please... this is killing me =/

              Thanks




              --
              "Therefore, send not to know For whom the bell tolls. It tolls for thee."

              :: Josh 'G-Funk' McDonald
              :: 0437 221 380 :: josh@...




              --
              "Therefore, send not to know For whom the bell tolls. It tolls for thee."

              :: Josh 'G-Funk' McDonald
              :: 0437 221 380 :: josh@...
            • Tracy Spratt
              Move is the default, there is extra work to copy. http://livedocs.adobe.com/flex/3/html/dragdrop_8.html Tracy ________________________________ From:
              Message 6 of 22 , May 1, 2008
              • 0 Attachment

                Move is the default, there is extra work to copy.

                 

                http://livedocs.adobe.com/flex/3/html/dragdrop_8.html

                Tracy

                 


                From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com ] On Behalf Of Josh McDonald
                Sent: Thursday, May 01, 2008 5:05 PM
                To: flexcoders@yahoogroups.com
                Subject: Re: [flexcoders] Drag and Drop question

                 

                How do you mark a drag/drop operation as having a certain type (ie Move)?

                -J

                On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@lariatinc. com> wrote:

                Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE.  The docs describe this.  Are the XML structures the same?

                 

                Tracy

                 


                From: flexcoders@yahoogro ups.com [mailto:flexcoders@yahoogro ups.com] On Behalf Of Josh McDonald
                Sent: Thursday, May 01, 2008 2:46 AM
                To: flexcoders@yahoogro ups.com
                Subject: Re: [flexcoders] Drag and Drop question

                 

                I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler.

                -J

                On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria. grupos@gmail. com> wrote:

                If i'm dragging an element from one tree to another. How do i get the
                updated xml of the tree i'm dragging off?

                For instance

                TREE 1
                - Element 1
                - Element 2

                TREE 2

                if i get the xml from tree 1 it would be something like
                <root>
                <element label="Element 1" />
                <element label="Element 2" />
                </root>

                but if i drag the Element 1 into the TREE 2 i want to get the xml
                without the "Element 1", without that node.

                i'm trying to get it creating a handler for "dragDrop" attribute on
                the Tree 2, but everytime i get it the items are not updated.

                Anyone know how to get the updated xml that tree 1 will have after i
                drop the element?

                Please... this is killing me =/

                Thanks





                --
                "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                :: Josh 'G-Funk' McDonald

                :: 0437 221 380 :: josh@gfunk007. com




                --
                "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                :: Josh 'G-Funk' McDonald
                :: 0437 221 380 :: josh@gfunk007. com

              • Josh McDonald
                Ew =) All my dragdrop stuff is funky custom components so I never noticed. But ew. -J ... -- Therefore, send not to know For whom the bell tolls. It tolls for
                Message 7 of 22 , May 1, 2008
                • 0 Attachment
                  Ew =)

                  All my dragdrop stuff is funky custom components so I never noticed. But ew.

                  -J

                  On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt <tspratt@...> wrote:

                  Move is the default, there is extra work to copy.

                   

                  http://livedocs.adobe.com/flex/3/html/dragdrop_8.html

                  Tracy

                   


                  From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald
                  Sent: Thursday, May 01, 2008 5:05 PM


                  To: flexcoders@yahoogroups.com
                  Subject: Re: [flexcoders] Drag and Drop question

                   

                  How do you mark a drag/drop operation as having a certain type (ie Move)?

                  -J

                  On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@...> wrote:

                  Actually I am pretty sure the list-based component's built-in drag/drop functionality does do this on a MOVE.  The docs describe this.  Are the XML structures the same?

                   

                  Tracy

                   


                  From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald
                  Sent: Thursday, May 01, 2008 2:46 AM
                  To: flexcoders@yahoogroups.com
                  Subject: Re: [flexcoders] Drag and Drop question

                   

                  I'm fairly certain that there's no voodoo to automatically delete nodes from your XML, you need to do that yourself in your drop handler.

                  -J

                  On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@...> wrote:

                  If i'm dragging an element from one tree to another. How do i get the
                  updated xml of the tree i'm dragging off?

                  For instance

                  TREE 1
                  - Element 1
                  - Element 2

                  TREE 2

                  if i get the xml from tree 1 it would be something like
                  <root>
                  <element label="Element 1" />
                  <element label="Element 2" />
                  </root>

                  but if i drag the Element 1 into the TREE 2 i want to get the xml
                  without the "Element 1", without that node.

                  i'm trying to get it creating a handler for "dragDrop" attribute on
                  the Tree 2, but everytime i get it the items are not updated.

                  Anyone know how to get the updated xml that tree 1 will have after i
                  drop the element?

                  Please... this is killing me =/

                  Thanks





                  --
                  "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                  :: Josh 'G-Funk' McDonald

                  :: 0437 221 380 :: josh@...




                  --
                  "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                  :: Josh 'G-Funk' McDonald
                  :: 0437 221 380 :: josh@...




                  --
                  "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                  :: Josh 'G-Funk' McDonald
                  :: 0437 221 380 :: josh@...
                • Rafael Faria
                  That s nice that everybody is learning from my question :p I m hereee o/ ehheheh someone can help me? :0 i still don t know how to get an updated tree after i
                  Message 8 of 22 , May 1, 2008
                  • 0 Attachment
                    That's nice that everybody is learning from my question :p

                    I'm hereee o/ ehheheh

                    someone can help me? :0

                    i still don't know how to get an updated tree after i move the node...

                    or there is any easy way to remove a node from an xml?!

                    thanks
                    rafael

                    --- In flexcoders@yahoogroups.com, "Josh McDonald" <dznuts@...> wrote:
                    >
                    > Ew =)
                    >
                    > All my dragdrop stuff is funky custom components so I never noticed.
                    But ew.
                    >
                    > -J
                    >
                    > On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt <tspratt@...> wrote:
                    >
                    > > Move is the default, there is extra work to copy.
                    > >
                    > >
                    > >
                    > > http://livedocs.adobe.com/flex/3/html/dragdrop_8.html
                    > >
                    > > Tracy
                    > >
                    > >
                    > > ------------------------------
                    > >
                    > > *From:* flexcoders@yahoogroups.com
                    [mailto:flexcoders@yahoogroups.com] *On
                    > > Behalf Of *Josh McDonald
                    > > *Sent:* Thursday, May 01, 2008 5:05 PM
                    > >
                    > > *To:* flexcoders@yahoogroups.com
                    > > *Subject:* Re: [flexcoders] Drag and Drop question
                    > >
                    > >
                    > >
                    > > How do you mark a drag/drop operation as having a certain type (ie
                    Move)?
                    > >
                    > > -J
                    > >
                    > > On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@...>
                    > > wrote:
                    > >
                    > > Actually I am pretty sure the list-based component's built-in
                    drag/drop
                    > > functionality does do this on a MOVE. The docs describe this.
                    Are the XML
                    > > structures the same?
                    > >
                    > >
                    > >
                    > > Tracy
                    > >
                    > >
                    > > ------------------------------
                    > >
                    > > *From:* flexcoders@yahoogroups.com
                    [mailto:flexcoders@yahoogroups.com] *On
                    > > Behalf Of *Josh McDonald
                    > > *Sent:* Thursday, May 01, 2008 2:46 AM
                    > > *To:* flexcoders@yahoogroups.com
                    > > *Subject:* Re: [flexcoders] Drag and Drop question
                    > >
                    > >
                    > >
                    > > I'm fairly certain that there's no voodoo to automatically delete
                    nodes
                    > > from your XML, you need to do that yourself in your drop handler.
                    > >
                    > > -J
                    > >
                    > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@...>
                    > > wrote:
                    > >
                    > > If i'm dragging an element from one tree to another. How do i get the
                    > > updated xml of the tree i'm dragging off?
                    > >
                    > > For instance
                    > >
                    > > TREE 1
                    > > - Element 1
                    > > - Element 2
                    > >
                    > > TREE 2
                    > >
                    > > if i get the xml from tree 1 it would be something like
                    > > <root>
                    > > <element label="Element 1" />
                    > > <element label="Element 2" />
                    > > </root>
                    > >
                    > > but if i drag the Element 1 into the TREE 2 i want to get the xml
                    > > without the "Element 1", without that node.
                    > >
                    > > i'm trying to get it creating a handler for "dragDrop" attribute on
                    > > the Tree 2, but everytime i get it the items are not updated.
                    > >
                    > > Anyone know how to get the updated xml that tree 1 will have after i
                    > > drop the element?
                    > >
                    > > Please... this is killing me =/
                    > >
                    > > Thanks
                    > >
                    > >
                    > >
                    > >
                    > >
                    > > --
                    > > "Therefore, send not to know For whom the bell tolls. It tolls for
                    thee."
                    > >
                    > > :: Josh 'G-Funk' McDonald
                    > >
                    > > :: 0437 221 380 :: josh@...
                    > >
                    > >
                    > >
                    > >
                    > > --
                    > > "Therefore, send not to know For whom the bell tolls. It tolls for
                    thee."
                    > >
                    > > :: Josh 'G-Funk' McDonald
                    > > :: 0437 221 380 :: josh@...
                    > >
                    > >
                    >
                    >
                    >
                    >
                    > --
                    > "Therefore, send not to know For whom the bell tolls. It tolls for
                    thee."
                    >
                    > :: Josh 'G-Funk' McDonald
                    > :: 0437 221 380 :: josh@...
                    >
                  • Josh McDonald
                    Does it disappear from the first tree (i mean visually)? On Fri, May 2, 2008 at 9:57 AM, Rafael Faria ... -- Therefore, send
                    Message 9 of 22 , May 1, 2008
                    • 0 Attachment
                      Does it disappear from the first tree (i mean visually)?

                      On Fri, May 2, 2008 at 9:57 AM, Rafael Faria <rafaelfaria.grupos@...> wrote:

                      That's nice that everybody is learning from my question :p

                      I'm hereee o/ ehheheh

                      someone can help me? :0

                      i still don't know how to get an updated tree after i move the node...

                      or there is any easy way to remove a node from an xml?!

                      thanks


                      rafael

                      --- In flexcoders@yahoogroups.com, "Josh McDonald" <dznuts@...> wrote:
                      >
                      > Ew =)
                      >
                      > All my dragdrop stuff is funky custom components so I never noticed.
                      But ew.
                      >
                      > -J
                      >
                      > On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt <tspratt@...> wrote:
                      >
                      > > Move is the default, there is extra work to copy.
                      > >
                      > >
                      > >
                      > > http://livedocs.adobe.com/flex/3/html/dragdrop_8.html
                      > >
                      > > Tracy
                      > >
                      > >
                      > > ------------------------------
                      > >
                      > > *From:* flexcoders@yahoogroups.com
                      [mailto:flexcoders@yahoogroups.com] *On
                      > > Behalf Of *Josh McDonald
                      > > *Sent:* Thursday, May 01, 2008 5:05 PM
                      > >
                      > > *To:* flexcoders@yahoogroups.com
                      > > *Subject:* Re: [flexcoders] Drag and Drop question
                      > >
                      > >
                      > >
                      > > How do you mark a drag/drop operation as having a certain type (ie
                      Move)?
                      > >
                      > > -J
                      > >
                      > > On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@...>

                      > > wrote:
                      > >
                      > > Actually I am pretty sure the list-based component's built-in
                      drag/drop
                      > > functionality does do this on a MOVE. The docs describe this.
                      Are the XML
                      > > structures the same?
                      > >
                      > >
                      > >
                      > > Tracy
                      > >
                      > >
                      > > ------------------------------
                      > >
                      > > *From:* flexcoders@yahoogroups.com
                      [mailto:flexcoders@yahoogroups.com] *On
                      > > Behalf Of *Josh McDonald
                      > > *Sent:* Thursday, May 01, 2008 2:46 AM
                      > > *To:* flexcoders@yahoogroups.com
                      > > *Subject:* Re: [flexcoders] Drag and Drop question
                      > >
                      > >
                      > >
                      > > I'm fairly certain that there's no voodoo to automatically delete
                      nodes
                      > > from your XML, you need to do that yourself in your drop handler.
                      > >
                      > > -J
                      > >
                      > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@...>

                      > > wrote:
                      > >
                      > > If i'm dragging an element from one tree to another. How do i get the
                      > > updated xml of the tree i'm dragging off?
                      > >
                      > > For instance
                      > >
                      > > TREE 1
                      > > - Element 1
                      > > - Element 2
                      > >
                      > > TREE 2
                      > >
                      > > if i get the xml from tree 1 it would be something like
                      > > <root>
                      > > <element label="Element 1" />
                      > > <element label="Element 2" />
                      > > </root>
                      > >
                      > > but if i drag the Element 1 into the TREE 2 i want to get the xml
                      > > without the "Element 1", without that node.
                      > >
                      > > i'm trying to get it creating a handler for "dragDrop" attribute on
                      > > the Tree 2, but everytime i get it the items are not updated.
                      > >
                      > > Anyone know how to get the updated xml that tree 1 will have after i
                      > > drop the element?
                      > >
                      > > Please... this is killing me =/
                      > >
                      > > Thanks
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > --
                      > > "Therefore, send not to know For whom the bell tolls. It tolls for
                      thee."
                      > >
                      > > :: Josh 'G-Funk' McDonald
                      > >
                      > > :: 0437 221 380 :: josh@...
                      > >
                      > >
                      > >
                      > >
                      > > --

                      > > "Therefore, send not to know For whom the bell tolls. It tolls for
                      thee."
                      > >
                      > > :: Josh 'G-Funk' McDonald
                      > > :: 0437 221 380 :: josh@...

                      > >
                      > >
                      >
                      >
                      >
                      >
                      > --
                      > "Therefore, send not to know For whom the bell tolls. It tolls for
                      thee."
                      >
                      > :: Josh 'G-Funk' McDonald
                      > :: 0437 221 380 :: josh@...
                      >




                      --
                      "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                      :: Josh 'G-Funk' McDonald
                      :: 0437 221 380 :: josh@...
                    • Alex Harui
                      The answer should be to wait for dragComplete on the source tree. ________________________________ From: flexcoders@yahoogroups.com
                      Message 10 of 22 , May 1, 2008
                      • 0 Attachment

                        The answer should be to wait for dragComplete on the source tree.

                         


                        From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Josh McDonald
                        Sent: Thursday, May 01, 2008 5:08 PM
                        To: flexcoders@yahoogroups.com
                        Subject: Re: [flexcoders] Re: Drag and Drop question

                         

                        Does it disappear from the first tree (i mean visually)?

                        On Fri, May 2, 2008 at 9:57 AM, Rafael Faria <rafaelfaria. grupos@gmail. com> wrote:

                        That's nice that everybody is learning from my question :p

                        I'm hereee o/ ehheheh

                        someone can help me? :0

                        i still don't know how to get an updated tree after i move the node...

                        or there is any easy way to remove a node from an xml?!

                        thanks


                        rafael

                        --- In flexcoders@yahoogro ups.com, "Josh McDonald" <dznuts@...> wrote:

                        >

                        > Ew =)

                        >
                        > All my dragdrop stuff is funky custom components so I never noticed.
                        But ew.
                        >
                        > -J
                        >

                        > On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt <tspratt@...> wrote:

                        >
                        > > Move is the default, there is extra work to copy.
                        > >
                        > >
                        > >
                        > >
                        target="_blank">http://livedocs. adobe.com/ flex/3/html/ dragdrop_ 8.html
                        > >
                        > > Tracy
                        > >
                        > >
                        > > ------------ --------- ---------
                        > >
                        > > *From:* flexcoders@yahoogro ups.com
                        [mailto:flexcoders@yahoogro ups.com] *On
                        > > Behalf Of *Josh McDonald
                        > > *Sent:* Thursday, May 01, 2008 5:05 PM
                        > >
                        > > *To:* flexcoders@yahoogro ups.com
                        > > *Subject:* Re: [flexcoders] Drag and Drop question
                        > >
                        > >
                        > >
                        > > How do you mark a drag/drop operation as having a certain type (ie
                        Move)?
                        > >
                        > > -J
                        > >

                        > > On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@...>


                        > > wrote:
                        > >
                        > > Actually I am pretty sure the list-based component's built-in
                        drag/drop
                        > > functionality does do this on a MOVE. The docs describe this.
                        Are the XML
                        > > structures the same?
                        > >
                        > >
                        > >
                        > > Tracy
                        > >
                        > >
                        > > ------------ --------- ---------
                        > >
                        > > *From:* flexcoders@yahoogro ups.com
                        [mailto:flexcoders@yahoogro ups.com] *On
                        > > Behalf Of *Josh McDonald
                        > > *Sent:* Thursday, May 01, 2008 2:46 AM
                        > > *To:* flexcoders@yahoogro ups.com
                        > > *Subject:* Re: [flexcoders] Drag and Drop question
                        > >
                        > >
                        > >
                        > > I'm fairly certain that there's no voodoo to automatically delete
                        nodes
                        > > from your XML, you need to do that yourself in your drop handler.
                        > >
                        > > -J
                        > >

                        > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria. grupos@.. .>


                        > > wrote:
                        > >
                        > > If i'm dragging an element from one tree to another. How do i get the
                        > > updated xml of the tree i'm dragging off?
                        > >
                        > > For instance
                        > >
                        > > TREE 1
                        > > - Element 1
                        > > - Element 2
                        > >
                        > > TREE 2
                        > >
                        > > if i get the xml from tree 1 it would be something like
                        > > <root>
                        > > <element label="Element 1" />
                        > > <element label="Element 2" />
                        > > </root>
                        > >
                        > > but if i drag the Element 1 into the TREE 2 i want to get the xml
                        > > without the "Element 1", without that node.
                        > >
                        > > i'm trying to get it creating a handler for "dragDrop"
                        attribute on
                        > > the Tree 2, but everytime i get it the items are not updated.
                        > >
                        > > Anyone know how to get the updated xml that tree 1 will have after i
                        > > drop the element?
                        > >
                        > > Please... this is killing me =/
                        > >
                        > > Thanks
                        > >
                        > >
                        > >
                        > >
                        > >
                        > > --
                        > > "Therefore, send not to know For whom the bell tolls. It tolls
                        for
                        thee."
                        > >
                        > > :: Josh 'G-Funk' McDonald
                        > >

                        > > :: 0437 221 380 :: josh@...

                        > >
                        > >
                        > >
                        > >
                        > > --


                        > > "Therefore, send not to know For whom the bell tolls. It tolls
                        for
                        thee."
                        > >
                        > > :: Josh 'G-Funk' McDonald

                        > > :: 0437 221 380 :: josh@...


                        > >
                        > >
                        >
                        >
                        >
                        >
                        > --
                        > "Therefore, send not to know For whom the bell tolls. It tolls for
                        thee."
                        >
                        > :: Josh 'G-Funk' McDonald

                        > :: 0437 221 380 :: josh@...

                        >




                        --
                        "Therefore, send not to know For whom the bell tolls. It tolls for thee."

                        :: Josh 'G-Funk' McDonald
                        :: 0437 221 380 :: josh@gfunk007. com

                      • Rafael Faria
                        Yes it does... I found a solution. I used callLater and apparently it works now. I couldn t understand callLater before but it is a function that it s saving
                        Message 11 of 22 , May 1, 2008
                        • 0 Attachment
                          Yes it does...

                          I found a solution. I used "callLater" and apparently it works now.

                          I couldn't understand callLater before but it is a function that it's
                          saving my life a lot lately! :P


                          Now the question i have is there is anyway to get the XML from the
                          tree without getting from the dataprovider? i'm getting
                          tree.dataProvider and for some things it works fine... but i'm
                          wondering if there is any other way to do that.

                          someone?!
                          raf


                          --- In flexcoders@yahoogroups.com, "Josh McDonald" <dznuts@...> wrote:
                          >
                          > Does it disappear from the first tree (i mean visually)?
                          >
                          > On Fri, May 2, 2008 at 9:57 AM, Rafael Faria <rafaelfaria.grupos@...>
                          > wrote:
                          >
                          > > That's nice that everybody is learning from my question :p
                          > >
                          > > I'm hereee o/ ehheheh
                          > >
                          > > someone can help me? :0
                          > >
                          > > i still don't know how to get an updated tree after i move the node...
                          > >
                          > > or there is any easy way to remove a node from an xml?!
                          > >
                          > > thanks
                          > >
                          > > rafael
                          > >
                          > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>,
                          "Josh
                          > > McDonald" <dznuts@> wrote:
                          > > >
                          > > > Ew =)
                          > > >
                          > > > All my dragdrop stuff is funky custom components so I never noticed.
                          > > But ew.
                          > > >
                          > > > -J
                          > > >
                          > > > On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt <tspratt@> wrote:
                          > > >
                          > > > > Move is the default, there is extra work to copy.
                          > > > >
                          > > > >
                          > > > >
                          > > > > http://livedocs.adobe.com/flex/3/html/dragdrop_8.html
                          > > > >
                          > > > > Tracy
                          > > > >
                          > > > >
                          > > > > ------------------------------
                          > > > >
                          > > > > *From:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
                          > > [mailto:flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] *On
                          > > > > Behalf Of *Josh McDonald
                          > > > > *Sent:* Thursday, May 01, 2008 5:05 PM
                          > > > >
                          > > > > *To:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
                          > > > > *Subject:* Re: [flexcoders] Drag and Drop question
                          > > > >
                          > > > >
                          > > > >
                          > > > > How do you mark a drag/drop operation as having a certain type (ie
                          > > Move)?
                          > > > >
                          > > > > -J
                          > > > >
                          > > > > On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt <tspratt@>
                          > > > > wrote:
                          > > > >
                          > > > > Actually I am pretty sure the list-based component's built-in
                          > > drag/drop
                          > > > > functionality does do this on a MOVE. The docs describe this.
                          > > Are the XML
                          > > > > structures the same?
                          > > > >
                          > > > >
                          > > > >
                          > > > > Tracy
                          > > > >
                          > > > >
                          > > > > ------------------------------
                          > > > >
                          > > > > *From:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
                          > > [mailto:flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] *On
                          > > > > Behalf Of *Josh McDonald
                          > > > > *Sent:* Thursday, May 01, 2008 2:46 AM
                          > > > > *To:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
                          > > > > *Subject:* Re: [flexcoders] Drag and Drop question
                          > > > >
                          > > > >
                          > > > >
                          > > > > I'm fairly certain that there's no voodoo to automatically delete
                          > > nodes
                          > > > > from your XML, you need to do that yourself in your drop handler.
                          > > > >
                          > > > > -J
                          > > > >
                          > > > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria <rafaelfaria.grupos@>
                          > > > > wrote:
                          > > > >
                          > > > > If i'm dragging an element from one tree to another. How do i
                          get the
                          > > > > updated xml of the tree i'm dragging off?
                          > > > >
                          > > > > For instance
                          > > > >
                          > > > > TREE 1
                          > > > > - Element 1
                          > > > > - Element 2
                          > > > >
                          > > > > TREE 2
                          > > > >
                          > > > > if i get the xml from tree 1 it would be something like
                          > > > > <root>
                          > > > > <element label="Element 1" />
                          > > > > <element label="Element 2" />
                          > > > > </root>
                          > > > >
                          > > > > but if i drag the Element 1 into the TREE 2 i want to get the xml
                          > > > > without the "Element 1", without that node.
                          > > > >
                          > > > > i'm trying to get it creating a handler for "dragDrop"
                          attribute on
                          > > > > the Tree 2, but everytime i get it the items are not updated.
                          > > > >
                          > > > > Anyone know how to get the updated xml that tree 1 will have
                          after i
                          > > > > drop the element?
                          > > > >
                          > > > > Please... this is killing me =/
                          > > > >
                          > > > > Thanks
                          > > > >
                          > > > >
                          > > > >
                          > > > >
                          > > > >
                          > > > > --
                          > > > > "Therefore, send not to know For whom the bell tolls. It tolls for
                          > > thee."
                          > > > >
                          > > > > :: Josh 'G-Funk' McDonald
                          > > > >
                          > > > > :: 0437 221 380 :: josh@
                          > > > >
                          > > > >
                          > > > >
                          > > > >
                          > > > > --
                          > > > > "Therefore, send not to know For whom the bell tolls. It tolls for
                          > > thee."
                          > > > >
                          > > > > :: Josh 'G-Funk' McDonald
                          > > > > :: 0437 221 380 :: josh@
                          > > > >
                          > > > >
                          > > >
                          > > >
                          > > >
                          > > >
                          > > > --
                          > > > "Therefore, send not to know For whom the bell tolls. It tolls for
                          > > thee."
                          > > >
                          > > > :: Josh 'G-Funk' McDonald
                          > > > :: 0437 221 380 :: josh@
                          > > >
                          > >
                          > >
                          > >
                          >
                          >
                          >
                          > --
                          > "Therefore, send not to know For whom the bell tolls. It tolls for
                          thee."
                          >
                          > :: Josh 'G-Funk' McDonald
                          > :: 0437 221 380 :: josh@...
                          >
                        • Alex Harui
                          You still should be able to use dragComplete instead. The dataProvider wraps the XML and is the only good way to get it. ________________________________ From:
                          Message 12 of 22 , May 1, 2008
                          • 0 Attachment

                            You still should be able to use dragComplete instead.

                             

                            The dataProvider wraps the XML and is the only good way to get it.

                             


                            From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rafael Faria
                            Sent: Thursday, May 01, 2008 7:08 PM
                            To: flexcoders@yahoogroups.com
                            Subject: [flexcoders] Re: Drag and Drop question

                             

                            Yes it does...

                            I found a solution. I used "callLater" and apparently it works now.

                            I couldn't understand callLater before but it is a function that it's
                            saving my life a lot lately! :P

                            Now the question i have is there is anyway to get the XML from the
                            tree without getting from the dataprovider? i'm getting
                            tree.dataProvider and for some things it works fine... but i'm
                            wondering if there is any other way to do that.

                            someone?!
                            raf

                            --- In flexcoders@yahoogro ups.com, "Josh McDonald" <dznuts@...> wrote:

                            >
                            > Does it disappear from the first tree (i mean visually)?
                            >
                            > On Fri, May 2, 2008 at 9:57 AM, Rafael Faria <rafaelfaria. grupos@.. .>
                            > wrote:
                            >
                            > > That's nice that everybody is learning from my question :p
                            > >
                            > > I'm hereee o/ ehheheh
                            > >
                            > > someone can help me? :0
                            > >
                            > > i still don't know how to get an updated tree after i move the
                            node...
                            > >
                            > > or there is any easy way to remove a node from an xml?!
                            > >
                            > > thanks
                            > >
                            > > rafael
                            > >
                            > > --- In flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>,
                            "Josh
                            > > McDonald" <dznuts@> wrote:
                            > > >
                            > > > Ew =)
                            > > >
                            > > > All my dragdrop stuff is funky custom components so I never
                            noticed.
                            > > But ew.
                            > > >
                            > > > -J
                            > > >
                            > > > On Fri, May 2, 2008 at 7:49 AM, Tracy Spratt <tspratt@>
                            wrote:
                            > > >
                            > > > > Move is the default, there is extra work to copy.
                            > > > >
                            > > > >
                            > > > >
                            > > > >
                            href="http://livedocs.adobe.com/flex/3/html/dragdrop_8.html">http://livedocs. adobe.com/ flex/3/html/ dragdrop_ 8.html
                            > > > >
                            > > > > Tracy
                            > > > >
                            > > > >
                            > > > > ------------ --------- ---------
                            > > > >
                            > > > > *From:* flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>
                            > > [mailto:flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>] *On
                            > > > > Behalf Of *Josh McDonald
                            > > > > *Sent:* Thursday, May 01, 2008 5:05 PM
                            > > > >
                            > > > > *To:* flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>
                            > > > > *Subject:* Re: [flexcoders] Drag and Drop question
                            > > > >
                            > > > >
                            > > > >
                            > > > > How do you mark a drag/drop operation as having a certain
                            type (ie
                            > > Move)?
                            > > > >
                            > > > > -J
                            > > > >
                            > > > > On Fri, May 2, 2008 at 5:32 AM, Tracy Spratt
                            <tspratt@>
                            > > > > wrote:
                            > > > >
                            > > > > Actually I am pretty sure the list-based component's
                            built-in
                            > > drag/drop
                            > > > > functionality does do this on a MOVE. The docs describe
                            this.
                            > > Are the XML
                            > > > > structures the same?
                            > > > >
                            > > > >
                            > > > >
                            > > > > Tracy
                            > > > >
                            > > > >
                            > > > > ------------ --------- ---------
                            > > > >
                            > > > > *From:* flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>
                            > > [mailto:flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>] *On
                            > > > > Behalf Of *Josh McDonald
                            > > > > *Sent:* Thursday, May 01, 2008 2:46 AM
                            > > > > *To:* flexcoders@yahoogro ups.com
                            <flexcoders% 40yahoogroups. com>
                            > > > > *Subject:* Re: [flexcoders] Drag and Drop question
                            > > > >
                            > > > >
                            > > > >
                            > > > > I'm fairly certain that there's no voodoo to automatically
                            delete
                            > > nodes
                            > > > > from your XML, you need to do that yourself in your drop
                            handler.
                            > > > >
                            > > > > -J
                            > > > >
                            > > > > On Thu, May 1, 2008 at 4:36 PM, Rafael Faria
                            <rafaelfaria. grupos@>
                            > > > > wrote:
                            > > > >
                            > > > > If i'm dragging an element from one tree to another. How do
                            i
                            get the
                            > > > > updated xml of the tree i'm dragging off?
                            > > > >
                            > > > > For instance
                            > > > >
                            > > > > TREE 1
                            > > > > - Element 1
                            > > > > - Element 2
                            > > > >
                            > > > > TREE 2
                            > > > >
                            > > > > if i get the xml from tree 1 it would be something like
                            > > > > <root>
                            > > > > <element label="Element 1" />
                            > > > > <element label="Element 2" />
                            > > > > </root>
                            > > > >
                            > > > > but if i drag the Element 1 into the TREE 2 i want to get
                            the xml
                            > > > > without the "Element 1", without that node.
                            > > > >
                            > > > > i'm trying to get it creating a handler for
                            "dragDrop"
                            attribute on
                            > > > > the Tree 2, but everytime i get it the items are not
                            updated.
                            > > > >
                            > > > > Anyone know how to get the updated xml that tree 1 will
                            have
                            after i
                            > > > > drop the element?
                            > > > >
                            > > > > Please... this is killing me =/
                            > > > >
                            > > > > Thanks
                            > > > >
                            > > > >
                            > > > >
                            > > > >
                            > > > >
                            > > > > --
                            > > > > "Therefore, send not to know For whom the bell tolls.
                            It tolls for
                            > > thee."
                            > > > >
                            > > > > :: Josh 'G-Funk' McDonald
                            > > > >
                            > > > > :: 0437 221 380 :: josh@
                            > > > >
                            > > > >
                            > > > >
                            > > > >
                            > > > > --
                            > > > > "Therefore, send not to know For whom the bell tolls.
                            It tolls for
                            > > thee."
                            > > > >
                            > > > > :: Josh 'G-Funk' McDonald
                            > > > > :: 0437 221 380 :: josh@
                            > > > >
                            > > > >
                            > > >
                            > > >
                            > > >
                            > > >
                            > > > --
                            > > > "Therefore, send not to know For whom the bell tolls. It
                            tolls for
                            > > thee."
                            > > >
                            > > > :: Josh 'G-Funk' McDonald
                            > > > :: 0437 221 380 :: josh@
                            > > >
                            > >
                            > >
                            > >
                            >
                            >
                            >
                            > --
                            > "Therefore, send not to know For whom the bell tolls. It tolls for
                            thee."
                            >
                            > :: Josh 'G-Funk' McDonald
                            > :: 0437 221 380 :: josh@...
                            >

                          • Rafael Faria
                            The thing is ... if the dataprovider is blank and i drop some element there, i m not able to retrieve it. For instance i create a tree 1 and i set the
                            Message 13 of 22 , May 1, 2008
                            • 0 Attachment
                              The thing is ... if the dataprovider is blank and i drop some element
                              there, i'm not able to retrieve it.

                              For instance i create a tree 1 and i set the dataprovider
                              <root>
                              <element label="test 1" />
                              <element label="test 2" />
                              </root>

                              and create a second tree without any dataprovider.

                              At the moment i drop an element to the second tree i even though it
                              show the element there the dataprovider is blank.

                              can you explain this?

                              or how do i get what is there?

                              --- In flexcoders@yahoogroups.com, "Alex Harui" <aharui@...> wrote:
                              >
                              > You still should be able to use dragComplete instead.
                              >
                              >
                              >
                              > The dataProvider wraps the XML and is the only good way to get it.
                              >
                              >
                              >
                            • Rafael Faria
                              So here is a example to what i m talking about. someone can tell me why: 1 - First test on this example if i drag an item from a branch(NOT the WHOLE BRANCH)
                              Message 14 of 22 , May 1, 2008
                              • 0 Attachment
                                So here is a example to what i'm talking about.

                                someone can tell me why:

                                1 - First test
                                on this example if i drag an item from a branch(NOT the WHOLE BRANCH)
                                from tree1 and drop to tree2, and than click on "get elements from
                                tree 2" button. it shows nothing... and if you keep adding elements it
                                will show commas.

                                How could i get the elements in the first place, and why it is showing
                                the commas (apparently is behaving as an ArrayColletion but why?
                                although this is not what i need to get... i need to get the elements).

                                2 - Second test
                                If i drop the 2 branches that sits on the tree 1 and click to see what
                                dataprovider is on tree2, it show the elements but in between the commas.

                                i'm not sure what to do =/

                                someone help... what i need is to be able to drop fomr tree1 to tree2
                                and get an xml from tree2 with exactly the same structure that shows
                                the elemnets. is this possible?




                                <?xml version="1.0" encoding="utf-8"?>
                                <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >

                                <mx:Script>
                                <![CDATA[
                                import mx.controls.Alert;

                                ]]>
                                </mx:Script>
                                <mx:XML id="capitals">
                                <root>
                                <Capitals label="U.S. State Capitals">
                                <capital label="AL" value="Montgomery"/>
                                <capital label="AK" value="Juneau"/>
                                <capital label="AR" value="Little Rock"/>
                                <capital label="AZ" value="Phoenix"/>
                                </Capitals>
                                <Capitals label="Canadian Province Capitals">
                                <capital label="AB" value="Edmonton"/>
                                <capital label="BC" value="Victoria"/>
                                <capital label="MB" value="Winnipeg"/>
                                <capital label="NB" value="Fredericton"/>
                                </Capitals>
                                </root>
                                </mx:XML>

                                <mx:HBox>

                                <mx:Tree id="tree1" dataProvider="{capitals}" showRoot="false"
                                labelField="@label" dragEnabled="true" dropEnabled="true" />
                                <mx:Tree id="tree2" showRoot="false" labelField="@label"
                                dropEnabled="true" dragEnabled="true" />
                                </mx:HBox>

                                <mx:Button click="Alert.show(tree1.dataProvider.toString())"
                                label="Get Dataprovider tree 1" />
                                <mx:Button click="Alert.show(tree2.dataProvider.toString())"
                                label="Get Dataprovider tree 2" />

                                </mx:Application>
                              • Alex Harui
                                If you don t define a dataprovider, an ArrayCollection will be used. In your case you want an XMLListCollection so you should initialize the second tree to
                                Message 15 of 22 , May 1, 2008
                                • 0 Attachment

                                  If you don’t define a dataprovider, an ArrayCollection will be used.  In your case you want an XMLListCollection so you should initialize the second tree to have one.

                                   


                                  From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rafael Faria
                                  Sent: Thursday, May 01, 2008 9:48 PM
                                  To: flexcoders@yahoogroups.com
                                  Subject: [flexcoders] Re: Drag and Drop question

                                   

                                  So here is a example to what i'm talking about.

                                  someone can tell me why:

                                  1 - First test
                                  on this example if i drag an item from a branch(NOT the WHOLE BRANCH)
                                  from tree1 and drop to tree2, and than click on "get elements from
                                  tree 2" button. it shows nothing... and if you keep adding elements it
                                  will show commas.

                                  How could i get the elements in the first place, and why it is showing
                                  the commas (apparently is behaving as an ArrayColletion but why?
                                  although this is not what i need to get... i need to get the elements).

                                  2 - Second test
                                  If i drop the 2 branches that sits on the tree 1 and click to see what
                                  dataprovider is on tree2, it show the elements but in between the commas.

                                  i'm not sure what to do =/

                                  someone help... what i need is to be able to drop fomr tree1 to tree2
                                  and get an xml from tree2 with exactly the same structure that shows
                                  the elemnets. is this possible?

                                  <?xml version="1.0" encoding="utf- 8"?>
                                  <mx:Application xmlns:mx="http://www.adobe. com/2006/ mxml"

                                  >

                                  <mx:Script>
                                  <![CDATA[
                                  import mx.controls. Alert;

                                  ]]>
                                  </mx:Script>
                                  <mx:XML id="capitals" >
                                  <root>
                                  <Capitals label="U.S. State Capitals">
                                  <capital label=" AL " value=" Montgomery " />
                                  <capital label="AK" value=" Juneau " />
                                  <capital label="AR" value=" Little Rock "/>
                                  <capital label="AZ" value=" Phoenix " />
                                  </Capitals>
                                  <Capitals label="Canadian Province Capitals">
                                  <capital label="AB" value=" Edmonton " />
                                  <capital label="BC" value=" Victoria " />
                                  <capital label="MB" value=" Winnipeg " />
                                  <capital label="NB" value=" Fredericton " />
                                  </Capitals>
                                  </root>
                                  </mx:XML>

                                  <mx:HBox>

                                  <mx:Tree id="tree1" dataProvider= "{capitals} " showRoot="false"
                                  labelField=" @label" dragEnabled= "true" dropEnabled= "true" />
                                  <mx:Tree id="tree2" showRoot="false" labelField=" @label"
                                  dropEnabled= "true" dragEnabled= "true" />
                                  </mx:HBox>

                                  <mx:Button click="Alert. show(tree1. dataProvider. toString( ))"
                                  label="Get Dataprovider tree 1" />
                                  <mx:Button click="Alert. show(tree2. dataProvider. toString( ))"
                                  label="Get Dataprovider tree 2" />

                                  </mx:Application>

                                • Tracy Spratt
                                  Also when tracing or alerting XML, ALWAYS use toXMLString() and not toString(). Search the archives if you want to understand why. Tracy
                                  Message 16 of 22 , May 2, 2008
                                  • 0 Attachment

                                    Also when tracing or alerting XML, ALWAYS use toXMLString() and not toString().  Search the archives if you want to understand why.

                                    Tracy

                                     


                                    From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com ] On Behalf Of Alex Harui
                                    Sent: Friday, May 02, 2008 2:13 AM
                                    To: flexcoders@yahoogroups.com
                                    Subject: RE: [flexcoders] Re: Drag and Drop question

                                     

                                    If you don’t define a dataprovider, an ArrayCollection will be used.  In your case you want an XMLListCollection so you should initialize the second tree to have one.

                                     


                                    From: flexcoders@yahoogro ups.com [mailto: flexcoders@ yahoogroups. com ] On Behalf Of Rafael Faria
                                    Sent: Thursday, May 01, 2008 9:48 PM
                                    To: flexcoders@yahoogro ups.com
                                    Subject: [flexcoders] Re: Drag and Drop question

                                     

                                    So here is a example to what i'm talking about.

                                    someone can tell me why:

                                    1 - First test
                                    on this example if i drag an item from a branch(NOT the WHOLE BRANCH)
                                    from tree1 and drop to tree2, and than click on "get elements from
                                    tree 2" button. it shows nothing... and if you keep adding elements it
                                    will show commas.

                                    How could i get the elements in the first place, and why it is showing
                                    the commas (apparently is behaving as an ArrayColletion but why?
                                    although this is not what i need to get... i need to get the elements).

                                    2 - Second test
                                    If i drop the 2 branches that sits on the tree 1 and click to see what
                                    dataprovider is on tree2, it show the elements but in between the commas.

                                    i'm not sure what to do =/

                                    someone help... what i need is to be able to drop fomr tree1 to tree2
                                    and get an xml from tree2 with exactly the same structure that shows
                                    the elemnets. is this possible?

                                    <?xml version="1.0" encoding="utf- 8"?>
                                    <mx:Application xmlns:mx="http://www.adobe. com/2006/ mxml"

                                    >

                                    <mx:Script>
                                    <![CDATA[
                                    import mx.controls. Alert;

                                    ]]>
                                    </mx:Script>
                                    <mx:XML id="capitals" >
                                    <root>
                                    <Capitals label="U.S. State Capitals">
                                    <capital label=" AL " value=" Montgomery " />
                                    <capital label="AK" value=" Juneau " />
                                    <capital label="AR" value=" Little Rock "/>
                                    <capital label="AZ" value=" Phoenix " />
                                    </Capitals>
                                    <Capitals label="Canadian Province Capitals">
                                    <capital label="AB" value=" Edmonton " />
                                    <capital label="BC" value=" Victoria " />
                                    <capital label="MB" value=" Winnipeg " />
                                    <capital label="NB" value=" Fredericton " />
                                    </Capitals>
                                    </root>
                                    </mx:XML>

                                    <mx:HBox>

                                    <mx:Tree id="tree1" dataProvider= "{capitals} " showRoot="false"
                                    labelField=" @label" dragEnabled= "true" dropEnabled= "true" />
                                    <mx:Tree id="tree2" showRoot="false" labelField=" @label"
                                    dropEnabled= "true" dragEnabled= "true" />
                                    </mx:HBox>

                                    <mx:Button click="Alert. show(tree1. dataProvider. toString( ))"
                                    label="Get Dataprovider tree 1" />
                                    <mx:Button click="Alert. show(tree2. dataProvider. toString( ))"
                                    label="Get Dataprovider tree 2" />

                                    </mx:Application>

                                  • zootpeet
                                    I am trying to implement drag and drop onto a tree. In the dropDrop handler, I want to be able to deny the drop from happening, based on which element of the
                                    Message 17 of 22 , Sep 16, 2008
                                    • 0 Attachment
                                      I am trying to implement drag and drop onto a tree. In the dropDrop
                                      handler, I want to be able to deny the drop from happening, based on
                                      which element of the tree is being dropped on.

                                      // r is the visible index in the tree
                                      var dropTarget:Tree = Tree(event.currentTarget);
                                      var r:int = dropTarget.calculateDropIndex(event);
                                      dstXmlTree.selectedIndex = r;
                                      var node:XML = dstXmlTree.selectedItem as XML;

                                      if (node.toXMLSting == "whatever") {
                                      // Allow drop -- HOW?
                                      } else {
                                      // Do NOT allow drop -- HOW?
                                      }

                                      How do I deny the drop?

                                      thanks!
                                    • Pan Troglodytes
                                      I believe you re going to need to handle the drop events yourself and not use the dropEnabled=true setting. When you do that, by default drop is denied and
                                      Message 18 of 22 , Sep 16, 2008
                                      • 0 Attachment
                                        I believe you're going to need to handle the drop events yourself and not use the dropEnabled=true setting.  When you do that, by default drop is denied and you have to tell it to allow it, like in the dragEnter event.  For example:

                                        private function dragEnterHandler(e:DragEvent):void
                                        {
                                          DragManager.acceptDragDrop(UIComponent(e.currentTarget));
                                          DragManager.showFeedback(DragManager.COPY);
                                        }


                                        On Tue, Sep 16, 2008 at 9:59 AM, zootpeet <cpeet@...> wrote:

                                        I am trying to implement drag and drop onto a tree. In the dropDrop
                                        handler, I want to be able to deny the drop from happening, based on
                                        which element of the tree is being dropped on.

                                        // r is the visible index in the tree
                                        var dropTarget:Tree = Tree(event.currentTarget);
                                        var r:int = dropTarget.calculateDropIndex(event);
                                        dstXmlTree.selectedIndex = r;
                                        var node:XML = dstXmlTree.selectedItem as XML;

                                        if (node.toXMLSting == "whatever") {
                                        // Allow drop -- HOW?
                                        } else {
                                        // Do NOT allow drop -- HOW?
                                        }

                                        How do I deny the drop?

                                        thanks!




                                        --
                                        Jason
                                      • Tracy Spratt
                                        I use the dropEnabled setting, but in all of the handlers, I call event.preventDefault(); Then I test the source and target and call
                                        Message 19 of 22 , Sep 16, 2008
                                        • 0 Attachment

                                          I use the dropEnabled setting, but in all of the handlers, I call event.preventDefault();  Then I test the source and target and call DragManager.showFeedback(), DragManager.acceptDragDrop() conditionally as required.

                                           

                                          Tracy

                                           


                                          From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com ] On Behalf Of Pan Troglodytes
                                          Sent: Tuesday, September 16, 2008 11:20 AM
                                          To: flexcoders@yahoogroups.com
                                          Subject: Re: [flexcoders] Drag and Drop question

                                           

                                          I believe you're going to need to handle the drop events yourself and not use the dropEnabled= true setting.  When you do that, by default drop is denied and you have to tell it to allow it, like in the dragEnter event.  For example:

                                          private function dragEnterHandler( e:DragEvent) :void
                                          {
                                            DragManager. acceptDragDrop( UIComponent( e.currentTarget) );
                                            DragManager. showFeedback( DragManager. COPY);
                                          }

                                          On Tue, Sep 16, 2008 at 9:59 AM, zootpeet <cpeet@bresnan. net> wrote:

                                          I am trying to implement drag and drop onto a tree. In the dropDrop
                                          handler, I want to be able to deny the drop from happening, based on
                                          which element of the tree is being dropped on.

                                          // r is the visible index in the tree
                                          var dropTarget:Tree = Tree(event.currentT arget);
                                          var r:int = dropTarget.calculat eDropIndex( event);
                                          dstXmlTree.selected Index = r;
                                          var node:XML = dstXmlTree.selected Item as XML;

                                          if (node.toXMLSting == "whatever") {
                                          // Allow drop -- HOW?
                                          } else {
                                          // Do NOT allow drop -- HOW?
                                          }

                                          How do I deny the drop?

                                          thanks!




                                          --
                                          Jason

                                        • Christophe
                                          Hello, How to Drag an Image A on the Image B. The image A replace the image B. And the image B come to replace the image A automatically. (There is a
                                          Message 20 of 22 , Sep 5, 2010
                                          • 0 Attachment
                                            Hello,

                                            How to Drag an Image A on the Image B.

                                            The image A replace the image B.
                                            And the image B come to replace the image A automatically. (There is a swapping).

                                            I use DragDropHandler and dragEnterHandler.

                                            Thank you,
                                            Christophe,
                                          Your message has been successfully submitted and would be delivered to recipients shortly.