1 Reply Latest reply on Feb 22, 2010 7:24 AM by leoserra

    Using xml with datagrid - problem with element attributes ...

    Kristian Thrane

      When i try to set the datafield in a DataGridColumn to an attribute, ex.: @isPermaLink - the value is not printet in the datagrid?

      My code:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="feedRequest.send()" layout="absolute" backgroundGradientColors="[#808080, #c0c0c0]">

      <mx:HTTPService id="feedRequest" url=" http://kristianthrane.dk/feed" useProxy="false" />

      <mx:Panel x="10" y="10" width="475" title="{feedRequest.lastResult.rss.channel.title}" id="panel1" height="531">
      <mx:DataGrid id="dgPosts" x="20" y="20" width="100%" dataProvider="{feedRequest.lastResult.rss.channel.item.guid}" height="100%">
      <mx:DataGridColumn headerText="Lande" dataField="@isPermaLink" />


      I hope someone has a tip ....

      Best regards,
      Kristian Thrane
        • 1. Re: Using xml with datagrid - problem with element attributes ...
          leoserra Level 2

          Hi Kristian,


          I'm with some problems, a bit alike yours, but from what I've seen, I would recomend you to see type errors...does the atribute "isPermaLink" inside the "guid" tag, or "title" tag?


          My problem is the opposite of what you have... I can place tag attributes in a datagrid, but I can't put in the same Datagrid the tag value. But I have no choice since the feed comes from a public webservice.


          My feed is:

          <search ver="3.0">
          <loc id="BRXX1094" type="1">Aveiro, Brazil</loc>
          <loc id="POXX0006" type="1">Aveiro, Portugal</loc>


          <mx:DataGrid x="10" y="53" width="365" id="dgLocation" dataProvider="{wSearch.lastResult.loc}" itemClick="callService(event);">
                 <mx:DataGridColumn headerText="Localidade" dataField="loc"/> //This doesn't work
                 <mx:DataGridColumn headerText="Referência" dataField="@id"/> //This does


          Hope it give you any ideas.


          Beste regards