3 Replies Latest reply on Jun 18, 2007 11:46 PM by holla2040

    Flex 3 XML DOM Level 2 mutation events

    holla2040 Level 1
      Folks,
      Where can I find out if Flex 3's XML object will support DOM Level 2 mutation events.
      http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents
      Thanks,
      Craig
        • 1. Re: Flex 3 XML DOM Level 2 mutation events
          jasowill Level 1
          We don't support this directly. However, notification of XML updates is supported, in two flavors. XMLListCollection provides Flex framework support including update events for operations on the XML and native player support. Take a look at the source code for mx.collections.XMLListAdapter.as for more details. The player supports notification of changes to XML natively and the Flex framework has some support for this via the XMLNotifiable interface and the XMLNotifier class (see mx.utils for these classes).

          jw
          • 2. Re: Flex 3 XML DOM Level 2 mutation events
            holla2040 Level 1
            JW,
            Thanks for the reply. I fooled around with XMLListCollection CollectionEvents but couldn't figure out how to extract the element,text or attribute node that was changed. My source XML is nothing like a list, its a large system adhoc configuration file. xdatalc:XMLListCollection = new XMLListCollection(new XMLList(xdata)) creates a list with a single item. The CollectionEvent.target is the top level node of my XML configuration file.

            There isn't much out there on XMLNotifiable and XMLNotifier. I found
            http://nondocs.blogspot.com/2007/04/mxutilsixmlnotifiable.html but will look at mx.collections.XMLListAdapter.as as you suggested.

            I'm frantically implementing something in Flex2 and wanted to see if Flex3's XML support added mutation events. I'm using mutation events in python and they made my architecture incredibly simple.

            Thanks again.
            Craig
            • 3. Re: Flex 3 XML DOM Level 2 mutation events
              holla2040 Level 1
              JW,
              Your second tip is EXACTLY what I needed!!! I even got it working in my MXML component, yah!

              Here's a stripped down version of my custom FormItem that implements IXMLNotifiable and receives xmlNotifications. You can look at mx.collections.XMLListAdapter.as for a more complicated example (look at their xmlNotification method for more fun tricks).

              Thanks for incredible tip.
              Craig