6 Replies Latest reply on Feb 15, 2007 12:40 AM by Dzihan

    XML, Flex, e4x --- help needed

    WestSide Level 1
      Hi,

      I am trying to understand why I am unable to output the value in an Alert or using "mx.utils.ObjectUtil"

      I have the following XML that is returned from a RemoteObject call. This data is then used in a <mx:Tree>

      <companies>
      - <company name="ABC Company">
      <contact id="2" name="John Doe" />
      <contact id="3" name="Jane Doe" />
      </company>
      - <company name="Z Systems">
      <contact id="4" name="Mark Doe" />
      </company>
      </companies>

      The tree uses the "change" attribute and fires of a method call. Below is this method.

      public function treeChanged(event:Event):void {
      selectedNode=Tree(event.target).selectedItem;
      Alert.show(selectedNode.@name);
      }

      This code works fine, but when I try to swap out @name for @id, because I ultimately am trying to populate a "detail" form with more detailed information. So using @name gives me the name of the contact, but I really want the id and the way I have it, just does not work for some reason when I use @id or @contactid

      Any help appreciated.

      -Westside