Professional Web Applications Themes

Switch from Flex Builder 2 to Flex Builder 3 - Macromedia Flex General Discussion

Hi All, I've developed an application in Flex Builder 2 and I'm trying to switch it in Flex Builder 3. My application receives data from a webservice, it returns a xml like this <result> <item _id="1"> <field1>value1</field1> <field2>value2</field2> </item> <item _id="2"> <field1>value1</field1> <field2>value2</field2> </item> </result> In Flex Bulder 2, I'm using an instruction like this: var results : ArrayCollection = new ArrayCollection ( [event.result.CallResult.result.item] [0]); in order to retrieve the data from the web sarvice call and link this data to the property dataprovider of a datagrid of my application: it works perfectly. In the ArrayCollection named results, I see ...

  1. #1

    Default Switch from Flex Builder 2 to Flex Builder 3

    Hi All,
    I've developed an application in Flex Builder 2 and I'm trying to switch it in
    Flex Builder 3.
    My application receives data from a webservice, it returns a xml like this

    <result>
    <item _id="1">
    <field1>value1</field1>
    <field2>value2</field2>
    </item>
    <item _id="2">
    <field1>value1</field1>
    <field2>value2</field2>
    </item>
    </result>

    In Flex Bulder 2, I'm using an instruction like this:
    var results : ArrayCollection = new ArrayCollection (
    [event.result.CallResult.result.item] [0]);
    in order to retrieve the data from the web sarvice call and link this data to
    the property dataprovider of a datagrid of my application: it works perfectly.
    In the ArrayCollection named results, I see the nodes returned by the
    webservice call and the attributes of the xml as well.
    Switching on Flex Builder 3, the same code used in Flex Builder 2 doesn't
    work. I mean that in Flex Builder 3 I'm not able to see, in the
    ArrayCollection, the attributes of the xml returned by webservice call but only
    the nodes of the xml.
    Is it a change (worst change) implemented in Flex Builder 3?
    If I try to format in "e4x" the data returned by the webservice, I obtain an
    XMLList collection. How is possible to link this data to my application
    datagrid?

    Thank you.

    Regards

    garag Guest

  2. #2

    Default Re: Switch from Flex Builder 2 to Flex Builder 3

    Note that if you are not already using reFormat="e4x", you do not have xml
    at all. You have a tree of dynamic objects.

    There were some changes to this conversion process, partly as I recall to
    better integrate with dot.net web services that returned DataTables. If
    youwant to stick with the nested object structure, perhaps you can find the
    description of the conversion in the docs. I don't use this, I prefer e4x xml.

    [Bindable]private var _xlcItems:XMLListCollection; //bind the dg to this
    instance-level var

    In the result handler:
    var xmlResults : XML = XML(event.result);
    trace(xmlResults)
    var xlItems:XMLList = xmlResults.item;
    trace(xlItems.length())
    xlcItems = new XMLListCollection(xlItems)

    Tracy

    ntsiii Guest

Similar Threads

  1. Flex Builder will not start
    By Ryfter1313 in forum Macromedia Flex General Discussion
    Replies: 12
    Last Post: July 29th, 10:55 PM
  2. Serious bug in Flex Builder 3
    By Handycam in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 25th, 10:08 PM
  3. Flex Charting 2 with Flex Builder 3
    By david.mills in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: April 11th, 07:06 PM
  4. Problem in Flex Builder UI After Installing Flex 3
    By BizDev2A in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 6th, 10:40 PM
  5. Flex/Flex Builder Trial
    By splattmstr in forum Macromedia Flex General Discussion
    Replies: 5
    Last Post: October 27th, 04:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139