0 Replies Latest reply on Feb 3, 2011 12:55 PM by nirnirnir

    Bind data to s:List from .NET DataTable

    nirnirnir

      I'm trying .Net DataTable as a return type from a WSDL service to an <s:List> in Flex Hero, I'm getting one item on the list which is saying "[object Object]" I can manually access the actual data but only see one row in the list saying "[Object object]"

       

      Any help will be much appreciated, here is the code:

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

      xmlns:s="library://ns.adobe.com/flex/spark"

      xmlns:mx="library://ns.adobe.com/flex/mx"

      xmlns:dbactions="services.dbactions.*"

      title="Home">

      <fx:Script>

      <![CDATA[

      import com.adobe.serializers.utility.TypeUtility;

       

      import mx.events.FlexEvent;

       

      protected function list_creationCompleteHandler(event:FlexEvent):void

      {

      GetSnapshotsByGeoResult.token = dBActions.GetSnapshotsByGeo(1);

      }

       

      ]]>

      </fx:Script>

      <fx:Declarations>

      <s:CallResponder id="GetSnapshotsByGeoResult"/>

      <dbactions:DBActions id="dBActions"/>

      </fx:Declarations>

      <s:List id="list" left="0" right="0" top="0" bottom="0"

      creationComplete="list_creationCompleteHandler(event)">

      <s:AsyncListView list="{TypeUtility.convertToCollection(GetSnapshotsByGeoResult.lastResult)}"/>

      <s:itemRenderer>

      <fx:Component>

      <s:MobileIconItemRenderer labelFunction="getUserInfo">

      <fx:Script>

      <![CDATA[

      import mx.core.mx_internal;

      import mx.utils.object_proxy;

      private function getUserInfo(item:Object):String

      {

      return item.Tables['tbl_snapshots'].Rows[1].snapshot_text;

      }

      ]]>

      </fx:Script>

      </s:MobileIconItemRenderer>

      </fx:Component>

      </s:itemRenderer>

      </s:List>

      </s:View>