ArrayCollection as result

Hi, trying to use ArrayCollection as result container but
cant get it to populate a DataGrid
this is based on example on page 1153/4 of flex2_devguide.pdf
.. usual stuff
<mx:HTTPService id="gameRequest" url="data/gameList.xml"
showBusyCursor="true"/>
<mx:ArrayCollection id="gameArray"
source="gameRequest.lastResult.FMPDSORESULT.ROW"/>
<mx:Button label="getGames" click="gameRequest.send()"
x="722" y="14"/>
<mx:DataGrid x="10" y="104" width="796" height="380"
id="gameList" dataProvider="{gameArray}" >
etc..
- with ArrayUtil conversion also, as in example
<mx:ArrayCollection id="gameArray"
source="{ArrayUtil.toArray(gameRequest.lastResult.FMPDSORESULT.ROW)}"/>
In both case all I is see is the DataGrid filled with the
source value as a string ie
"{ArrayUtil.toArray(gameRequest.lastResult.FMPDSORESULT.ROW)}" then
no update after the send?
Data is ok because ignoring the ArrayCollection thus, loads
the data fine:
<mx:DataGrid x="10" y="104" width="796" height="380"
id="gameList"
dataProvider="{gameRequest.lastResult.FMPDSORESULT.ROW}" >
tried other similar examples for instance page 1142/3, copied
direct with only changes to load my data, with ArrayCollection
nothing, with dataProvider no problem
FYI Mac Flex 2
thanks for any help.

Here you go, i just tested this so i know it works. Try doing
your data manipulation in script as its allot easier to tell whats
going on:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:HTTPService id="gameRequest" url="data/gameList.xml"
showBusyCursor="true" result="{parseGames(event)}"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.utils.ArrayUtil;
import mx.collections.ArrayCollection;
private var gameArray:Array; //Stores assets to load //
private function parseGames(event:ResultEvent):void {
gameArray=
mx.utils.ArrayUtil.toArray(event.result.FMPDSORESULT.ROW);
debug.text= "array created!";
gameList.dataProvider= gameArray[0];
debug.text= "data grid populated!";
]]>
</mx:Script>
<mx:Button label="getGames" click="gameRequest.send()"
x="10" y="10"/>
<mx:DataGrid x="10" y="40" width="796" height="380"
id="gameList">
</mx:DataGrid>
<mx:Label x="113" y="14" text="debug" id="debug"/>
</mx:Application>

Similar Messages

  • Can anyone solve this simple MVC problem with ArrayCollection

    I have very simple application trying to understand how to apply MVC without any framework. There are quite a few exemples on the net but most do not deal with complex data.
    here is my application with 4 files: MVCtest.mxml, MyController.as, MyModel.as and MyComponent.as
    first the Model MyModel.as
    package model
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import mx.collections.ArrayCollection;
    [Event(name="ArrayColChanged", type="flash.events.Event")]
    [Bindable]
    public class MyModel extends EventDispatcher
      private static var instance:MyModel;
      public static const ARRAYCOL_CHANGED:String = "ArrayColChanged";
      private var _myArrayCol:ArrayCollection;
      public function MyModel(target:IEventDispatcher=null)
       super(target);
       instance = this;
      public static function getInstance():MyModel
       if(instance == null)
        instance = new MyModel();
       return instance;
      public function get myArrayCol():ArrayCollection
       return _myArrayCol;
      public function set myArrayCol(value:ArrayCollection):void
       _myArrayCol = new ArrayCollection(value.source);
       dispatchEvent(new Event(ARRAYCOL_CHANGED));
    then the controller: MyController.as
    package controller
    import components.MyComponent;
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import model.MyModel;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.remoting.RemoteObject;
    public class MyController extends EventDispatcher
      [Bindable]
      public var view:MVCtest;
      [Bindable]
      public var componentView:MyComponent;
      private var _model:MyModel = MyModel.getInstance();
      public function MyController(target:IEventDispatcher=null)
       super(target);
       _model.addEventListener("ArrayColChanged", onArrayColChange);
      public function initialise(event:Event):void
       getData();
      public function getData():void
       var dataRO:RemoteObject = new RemoteObject;
       dataRO.endpoint = "gateway.php";
       dataRO.source = "MytestdbService";
       dataRO.destination = "MytestdbService";
       dataRO.addEventListener(ResultEvent.RESULT, dataROResultHandler);
       dataRO.addEventListener(FaultEvent.FAULT, dataROFaultHandler);
       dataRO.getAllMytestdb();   
      public function dataROResultHandler(event:ResultEvent):void
       _model.myArrayCol = new ArrayCollection((event.result).source);
      public function dataROFaultHandler(event:FaultEvent):void
       Alert.show(event.fault.toString());
      public function onArrayColChange(event:Event):void
       componentView.myDataGrid.dataProvider = _model.myArrayCol;
    This is the main application: MVCtest.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application 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:controller="controller.*"
          xmlns:components="components.*"
          width="600" height="600"
          creationComplete="control.initialise(event)">
    <fx:Declarations>
      <controller:MyController id="control" view = "{this}"/>
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import model.MyModel;
       import valueObjects.MyVOorDTO;
       [Bindable]
       private var _model:MyModel = MyModel.getInstance();
      ]]>
    </fx:Script>
    <s:VGroup paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
      <s:Label fontSize="20" fontWeight="bold" text="MVC Test with components"
         verticalAlign="middle"/>
      <components:MyComponent/>
    </s:VGroup>
    </s:Application>
    And this is the component: MyComponent.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">
    <s:layout>
      <s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"/>
    </s:layout>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label fontSize="16" fontWeight="bold" text="My Component " verticalAlign="bottom"/>
    <s:DataGrid id="myDataGrid" width="100%" height="100%" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="mystring" headerText="String"></s:GridColumn>
        <s:GridColumn dataField="myinteger" headerText="Integer"></s:GridColumn>
        <s:GridColumn dataField="myreal" headerText="Real"></s:GridColumn>
        <s:GridColumn dataField="mydate" headerText="Date"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
    </s:DataGrid>
    </s:Group>
    Here is the code to generate the database:
    CREATE DATABASE mytest;
    CREATE TABLE myTestDB
          myid INT UNSIGNED NOT NULL AUTO_INCREMENT,
          mystring CHAR(15) NOT NULL,
          myinteger INT NOT NULL,
          myreal DECIMAL(6,2) NOT NULL,
          mydate DATE NOT NULL,
          PRIMARY KEY(myid)
    ) ENGINE = InnoDB;
    INSERT INTO myTestDB (mystring, myinteger, myreal, mydate) VALUES ('Test', 123, 45.67, '2012-01-01'), ('Practice', 890, 12.34, '2012-02-01'), ('Assay', 567, 78.90, '2011-10-01'), ('Trial', 111, 22.22, '2009-09-09'), ('Experiment', 333, 44.44, '1999-04-15'), ('Challenge', 555, 66.66, '2012-12-21');
    And finally here is the PHP script.
    <?php
    class myVOorDTO
      var $_explicitType = "valueObjects.myVOorDTO";
      public $myid;
      public $mystring;
      public $myinteger;
      public $myreal;
      public $mydate;
      public function __construct()
        $this->myid = 0;
        $this->mystring = "";
        $this->myinteger = 0;
        $this->myreal = 0.0;
        $this->mydate = date("c");
    class MytestdbService
      var $username = "yourusername";
      var $password = "yourpassword";
      var $server = "yourserver";
      var $port = "yourport";
      var $databasename = "mytest";
      var $tablename = "mytestdb";
      var $connection;
      public function __construct()
        $this->connection = mysqli_connect(
        $this->server, $this->username, $this->password, $this->databasename, $this->port);
    * Returns all the rows from the table.
    * @return myVOorDTO
      public function getAllMytestdb()
        $query = "SELECT * from $this->tablename";
        $result = mysqli_query($this->connection, $query);
        $results = array();
        while ($obj = mysqli_fetch_assoc($result))
          $row = new myVOorDTO();
          $row->myid = $obj['myid'] + 0;
          $row->mystring = $obj['mystring'];
          $row->myinteger = $obj['myinteger'] + 0;
          $row->myreal = $obj['myreal'] + 0.0;
          $row->mydate = new Datetime($obj['mydate']);
          array_push($results, $row);
        return $results;
    ?>
    My understanding as to what is going on is: (1) on creation complete the application launch the initialise() function of the controller (2) this function starts the remoteObject which get the data (3) once the results arrive the resultHandler store the data into the ArrayCollection of the model ***this does not work*** (4) even if part 3 did not work, the setter of the ArrayCollection in the model send an event that it has been changed (5) the controller receive this event and assigns the ArrayCollection of the model as the dataprovider for the datagrid in the compoent.
    Of course, since the ArrayCollection is null, the application gives an error as the dataProvider for the datagrid is null.
    What is missing in this application to make it work properly? I believe this is an example that could help a lot of people.
    Even if I change the setter in the model to _myArrayCol = ObjectUtil.copy(value) as ArrayCollection; it still does not work.
    Also, it seems that the remoteObject does not return a typed object (i.e. myVOorDTO) but rather generic objects. I am usually able to make this works but in this particular application I have not managed to do it. Again what's missing?
    Thanks for any help with this!

    Calendar c = GregorianCalendar.getInstance();
    c.set(Calendar.YEAR,2000);
    System.out.println(c.getActualMaximum(Calendar.WEEK_OF_YEAR));
    c.set(Calendar.YEAR,2001);
    System.out.println(c.getActualMaximum(Calendar.WEEK_OF_YEAR));But it says that 2000 has 53 weeks and 2001 has 52.

  • Store into an array the results of a PhpService

    Hi all I have a problem with flex and I'm stuck and we need help, this is urgent !!!!!! please
    My problem is that I would like to store in an array or ArrayCollection the result of running a php function (in my case "getTestSesion ()") to make any changes on some of the elements that my array will contain, before placing it on my  DataGrid.dataProvider (when I say change I mean items such as concatenate something to a specific element)
    I leave more and less what I have done.
    This is my table in mysql:
    CREATE TABLE IF NOT EXISTS `sesion` (
      `id_ses` int(1) NOT NULL AUTO_INCREMENT,
      `nombre_sesion` varchar(18) NOT NULL,
      `detalle_sesion` varchar(32) DEFAULT NULL,
      PRIMARY KEY (`id_ses`)
    ) ENGINE=InnoDB
    and I create this function to read my table using the Flash Builder wizard for DB connection:
    public function getTestSesion() {
         $stmt = mysqli_prepare($this->connection,
              "select id_ses as id,
                 nombre_sesion as nombre
               from sesion");    
          $this->throwExceptionOnError();
          mysqli_stmt_execute($stmt);
          $this->throwExceptionOnError();
          $rows = array();
          mysqli_stmt_bind_result($stmt, $row->id, $row->nombre);
          while (mysqli_stmt_fetch($stmt)) {
              $rows[] = $row;
              $row = new stdClass();
              mysqli_stmt_bind_result($stmt, $row->id, $row->nombre);
          mysqli_stmt_free_result($stmt);
          mysqli_close($this->connection);
          return $rows;
    and on my aplication i have:
    <fx:Script>
       protected function miDatagrid_creationCompleteHandler(event:FlexEvent):void
              createSesionResult.token = pruebasService.getTestSesion();
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="createSesionResult"/>
    </fx:Declarations>
        <mx:DataGrid x="139" y="90" id="dataGrid"
                     creationComplete="miDatagrid_creationCompleteHandler(event)"
                     dataProvider="{createSesionResult.lastResult}">
            <mx:columns>
                <mx:DataGridColumn headerText="id" dataField="id"/>
                <mx:DataGridColumn headerText="nombre" dataField="nombre"/>
            </mx:columns>
        </mx:DataGrid>

    Hello everybody
    please can somebody help me:
    this is another simple example:
    I have this function into my service class:
    public function test($my_string)
      // creating an array by explode command
      $my_array = explode(" ",$my_string);
      return $my_array; // returning the array
    and since my aplication i call this like this:
    var myarray:Array = salfventasseriesService.test("this is a test");
    but i have this error:
    Multiple markers at this line:
    -1067: Implicit coercion of a value of type mx.rpc:AsyncToken to an unrelated type Array.
    -myarray
    How can I put the resul into an ARRAY ?
    can anybody help me ?

  • ArrayCollection/Single XML Node problem

    I've encountered a very frustrating situation that I would
    LOVE some help with. I am getting xml back from an HTTPService that
    I'm casting as an ArrayCollection. Very simple code:
    [Bindable]
    private var queueCol:ArrayCollection;
    queueCol = event.result.Response.CallQueue.QueueItem;
    This works great as long as there are multiple "QueueItem"
    nodes. once the sml gets down to ONE QueueItem Flex throws an ugly
    error. I have found this in other areas as well. It seems Flex
    cannot reconcile xml of only single child nodes.
    Has anyone else encountered this? Is there a
    workaround/different approach to get around this?

    You might try something like:
    queueCol = new
    ArrayCollection(event.result.Response.CallQueue.QueueItem is
    Array?event.result.Response.CallQueue.QueueItem:[event.result.Response.CallQueue.QueueIte m]);
    The SimpleXMLDecoder starts of converting a child node to a
    property, but if there's already something there, it converts it to
    an array. So flex doesn't have any problem reconciling xml with
    single child node - it is making a best guess in the absence of an
    xml schema. You can write your own decoder if you like (this is
    what I have done), and hand it to the HTTPService to use in place
    of the default. Then you can make it read a schema (if you have
    one).

  • Arraycollection conversion to chart data

    I'm trying to get ArrayCollection mapped to an array using
    the Blazeds turnkey sample code. In the sqladmin example, they are
    creating a List object in the Java code by executing the SQL query
    and storing it like this:
    // relevant code...
    while (rs.next()) {
    row=new HashMap();
    for (int i = 1; i <= colCount; i++) {
    row.put(rsmd.getColumnName(i), rs.getString(i));
    list.add(row);
    Then they put this result in a dataGrid:
    <mx:DataGrid id="dg" dataProvider="{resultSet}"
    width="100%" height="100%"/>
    and the following method.
    private function resultHandler(event:ResultEvent):void {
    resultSet = ArrayCollection(event.result);
    I'd like to display the same data in a chart, but I don't
    know how to do this. What I'd like to do is something like this:
    //pseudo code
    Horizontal Axis (x) = Data from Column 1
    Vertical Axis (y) = Data from Column 2
    ..or something like that. Anyone know what class the
    HashMap/List is sending back so that I can convert the info into
    Dates or numbers or somethow get it to show up on the chart?
    I was trying something like this, but it doesn't work:
    var axisArray:ArrayCollection = new ArrayCollection;
    for each (var obj:Object in resultSet) {
    var f:Number = new Number(obj);
    result.addItem(f);
    // axis data provider = axisArray

    yes, it seems that I was messing up in assigning the results
    to the various axis definitions. I assumed the data wasn't there,
    but it really was. I didn't need this loop at all:
    var axisArray:ArrayCollection = new ArrayCollection;
    for each (var obj:Object in resultSet) {
    var f:Number = new Number(obj);
    result.addItem(f);
    just assigning the data correctly:
    series1.dataProvider = resultSet;
    series1.xField="TIME";
    series1.yField="VALUE";
    Thanks for the help!

  • ArrayCollection to webservices

    OK i know how to get the result i want and bind it to a
    datagrid.
    I know how to send simple variables to my webservice (built
    in coldfusion) and get a result back
    but I dont know how to send an arrayCollection from flex to a
    webservice. I know flash remoting is supposed to be better, but I
    dont have root access to the server.
    anyone point me to a resource that will walk me through
    this?

    can u explain abt this line
    var plist:ArrayCollection = e .
    result.simRingNumberList;

  • Get Results From RemoteObject

    Not sure what's gotten into me today... feel like I'm loosing it.
    I'm getting a list of users back from a RemoteObject method call. I can't seem to remember how to parse them out. Is this the appropriate method?
    private function loadUsersByGroupHandler(event:ResultEvent):void
         try
              this._assignedUsers = event.result as ArrayCollection;
         catch (error:FaultEvent)
              this.parentDocument.faultHandle(event);
    The problem here is that when I do this, I am unable to inspect the resulting ArrayCollection for length or anything else, as the following fails (no error is thrown, but also no alert is shown):
    private function loadUsersByGroupHandler(event:ResultEvent):void
         try
                   Alert.show(ArrayCollection(event.result).length.toString());
              this._assignedUsers = event.result as ArrayCollection;
         catch (error:FaultEvent)
              this.parentDocument.faultHandle(event);

    Try this._myAC= new ArrayCollection( event.result as Array)
    Sincerely,
    Michael
    El 22/04/2009, a las 14:22, Miggl <[email protected]> escribió:
    >
    Not sure what's gotten into me today... feel like I'm loosing it.
    >
    I'm getting a list of users back from a RemoteObject method call. I 
    can't seem to remember how to parse them out. Is this the 
    appropriate method?
    private function loadUsersByGroupHandler(event:ResultEvent):void
         try
              this._assignedUsers = event.result as ArrayCollection;
         catch (error:FaultEvent)
              this.parentDocument .faultHandle(event);
    >
    >
    The problem here is that when I do this, I am unable to inspect the 
    resulting ArrayCollection for length or anything else, as the 
    following fails (no error is thrown, but also no alert is shown):
    private function loadUsersByGroupHandler(event:ResultEvent):void
         try
    Alert.show(ArrayCollection(event.result).length.toString());
              this._assignedUsers = event.result as ArrayCollection;
         catch (error:FaultEvent)
              this.parentDocument .faultHandle(event);
    >

  • HTTPService and ArrayCollection Error

    Update:
    After some debugging I think I have found my own answer .
    I have added the following line to the event code:
    var i:int = evt.result.result.item.length;
    When debugging this value if my XMl list has 2 or more items
    then the length value returns 2 or more.
    i.e. 2 items length =2, 6 items length=6 and so on.
    but for 1 item the length =0 (?) so although there is 1 item
    in the list and it shows in the debugger the value reported is 0
    which might explain wht it cannot be set as an ArrayCollection.
    I am processing the result of an HTTPService send in an event
    to create an arraycollection of items( using some example code I
    found on the net). Basically if the data is received OK then the
    items in the XML are cast an an arraycollection and they are
    processed. The lines to cast this is as follows.
    var source:ArrayCollection = evt.result.result.item as
    ArrayCollection;
    var cursor:IViewCursor = source.createCursor();
    while (!cursor.afterLast){
    var currentObj:Object = cursor.current;
    //..... code here to manipulate data
    cursor.moveNext();
    I then iterate through the cursor. The problem I have is
    that it all works fine if there are 2 or more "items" returned in
    the XML but if there is only 1 item the source var does not get
    created and so the rest of the code fails. Does anyone have any
    ideas as to why ? I guess I can "get around it" by detecting only 1
    item and processing it differently but it would be good to use the
    same code.
    btw. only be using flex for 4 days so I think it is very
    probably my extreme lack of actionscript knowledge.
    thanks.

    I had the same problem and I got the solution from the net:
    if( event.result.dataroot.city is ArrayCollection )
    myAC = event.result.dataroot.city as ArrayCollection
    else
    myAC = new
    ArrayCollection(ArrayUtil.toArray(event.result.dataroot.city));
    I don't mean to hijack the post but it seems relevant. I
    encounter the same problem with the Array class (instead of
    ArrayCollection). I've used the above method and it does return the
    length of 1. However, I tried to access the sub-element and it
    crashes because that becomes a null.
    Again, the array was set as follow initially which crashes
    right the way when there is one market on that day:
    MarketArray = event.result.list.day.Market.source as Array;
    This will be fine:
    MarketArray = new Array
    (ArrayUtil.toArray(event.result.list.day.Market.source ));
    But, as soon as I access the sub-items underthe market, it
    return null.
    var iSize = MarketArray[0].stats.length; // where it should
    return 3 items.
    Anyone has input?

  • DataGrids, ArrayCollections, Ohh My

    Hello, I am new to flex and Actionscript, and have been
    working with flex 3 with as3. I am using the flex builder 3 beta 1.
    I have only been working with in this environment for only about a
    month so please be patient. I do have experience in ColdFusion,
    MYSQL, and basic web technologies such as CSS, HTML, a little JS.
    So here is my problem.
    my current project is a custom CMS - being Customer
    Management Softeware.
    <mx:RemoteObject id="customer_RO" destination="ColdFusion"
    source="cms.cfc.customerConnection">
    <mx:method name="getCustomers"
    result="customerHandler(event)"/>
    <mx:method name="getContacts"
    result="contactHandler(event)"/>
    </mx:RemoteObject>
    <mx:Script>
    <![CDATA[
    /* Creates Bindable Array variable for the Customer List */
    [Bindable]
    private var CustomerList:ArrayCollection;
    [Bindable]
    private var ContactList:ArrayCollection;
    /* Creates an application initialization to load before
    application loaded */
    private function initApp():void
    customer_RO.getCustomers();
    customer_RO.getContacts();
    /* Created data handlers for the remoteObject method */
    private function customerHandler(event:ResultEvent):void
    CustomerList = ArrayCollection(event.result);
    private function contactHandler(event:ResultEvent):void
    ContactList = ArrayCollection(event.result);
    ]]>
    </mx:Script>
    Now here are my data grids.
    <mx:DataGrid id="dg1" x="0" y="0" width="100%"
    height="100%" dataProvider="{CustomerList}">
    <mx:columns>
    <mx:DataGridColumn headerText="Name"
    dataField="companyname" width="250"/>
    <mx:DataGridColumn headerText="Address"
    dataField="street1"/>
    <mx:DataGridColumn headerText="City" dataField="city"
    width="100"/>
    <mx:DataGridColumn headerText="State"
    dataField="statecode" width="50"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:DataGrid x="0" y="0" width="100%" height="100%"
    dataProvider="{ContactList}">
    <mx:columns>
    <mx:DataGridColumn headerText="Name"
    dataField="firstname" width="150"/>
    <mx:DataGridColumn headerText="Email" dataField="address"
    width="175"/>
    <mx:DataGridColumn headerText="Phone"
    dataField="phonenumber" width="175"/>
    </mx:columns>
    </mx:DataGrid>

    Hi,
    I think you have to try following code.
    private function customerHandler(event:ResultEvent):void
    var dataArray:Array = new Array();
    dataArray = event.result as Array;
    CustomerList = new ArrayCollection(dataArray);
    This will work for you cose i have faced same problem It
    solved my problem.
    thanks,
    Megha

  • Text Input and dataProvider

    I have Text input box for the user to enter the heading for a new record in NewRecord form.
    Like:
    <mx:TextInput text="Enter Subject Here"/>
    and then it is saved in the Database...
    I have another form called ChangeRecord so that the user can change the heading or Subject..
    How do i populate the name already in DB in the TextInput Box above... There is no dataProvider pram in TextInput...
    I have the following:
    CODE
    [Bindable] public var NR:ArrayCollection;
    private function resultNR(event:ResultEvent):void{
               NR:ArrayCollection(event.result);
    <mx:TextInput text="Enter Subject Here"/>
    Any help is appreciated.

    Hi,
    Post this over at the flex general discussions forum - they'll have better answers for this.
    -Anirudh

  • How to get the selectedIndex from a combobox made by classFactory?

    Dear All,
    I am trying to get the selectedIndex or selecetedItem.banda_id when changing a combobox that is created by classFactory and it is inside a datagrid.
    The code I have is:
    MXML:
    <mx:DataGrid width="100%" height="100%" id="salas_fin_dg" editable="true">
         <mx:columns>
    <mx:DataGridColumn headerText="Titulo" dataField="titulo" editable="false" width="250"/>
    <mx:DataGridColumn headerText="Data" dataField="start_dt" editable="false"/>
    <mx:DataGridColumn headerText="Dur" dataField="duration" editable="false" width="40"/>
    <mx:DataGridColumn headerText="Banda" dataField="banda_nome" editable="true" itemEditor="{combofac}"/>
    <mx:DataGridColumn headerText="$ Ensaio" dataField="total_ensaio" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ Bar" dataField="total_bar" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ Loja" dataField="total_loja" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ CC" dataField="total_cc" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ CH" dataField="total_ch" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ DI" dataField="total_di" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ Pend" dataField="total_pend" editable="true" itemEditor="controls.NumericInput"/>
         </mx:columns>
    </mx:DataGrid>
    Script:
    private function getSalasFinHandler(event:ResultEvent):void
    salas_fin_lst = new ArrayCollection(event.result as Array);
    salas_fin_dg.dataProvider = salas_fin_lst;
    myservice.getBandas();
    combofac=new ClassFactory(ComboBox);
         combofac.properties={dataProvider:bandas_lst, labelField:"banda_nome", prompt:"Selecione"};
    I am using Remote Object to get the data from a DB, and it is working properly.
    As I will update the datagrid cell values, I would like to update them on the DB.
    In order to do that, I would need to access the banda_id value, that is part of the combofac dataprovider, I mean that this dataprovider has 2 columns, being banda_nome and banda_id.
    The question is how to get the banda_id value, when I change the comobobox?
    Many thanks in advance,
    Gines

    Dear harUI and kolinitcom,
    Thanks for the your prompt response and guidelines.
    I went to research a little bit more on the itemEditEnd and found a way to access the data inside the combobox.
    The code for all application goes below. If you click on the button, it will show you all the datagrid data, plus the ID of the combobox when changed.
    Thanks again,
    Gines
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout="vertical"
            verticalAlign="middle"
            backgroundColor="white" initialize="init();">
            <mx:Script>
               <![CDATA[
               import mx.utils.ObjectUtil;
               import mx.controls.ComboBox;
               import mx.controls.Alert;
               import mx.events.DataGridEvent;
               import mx.events.*;
          [Bindable]
          private var combofac:ClassFactory;
      public var newVal:String;
          private function init():void
            combofac=new ClassFactory(mx.controls.ComboBox);
            combofac.properties={dataProvider:arrcombo, prompt:"Selecione", labelField:"label"};      
                public function getCellInfo(event:DataGridEvent):void {
                    var myEditor:ComboBox = ComboBox(event.currentTarget.itemEditorInstance);
                    newVal = myEditor.selectedItem.data;
    public function mostra():void
    var dados:Object = new Object;
    dados.nome = dataGrid.selectedItem.label;
    dados.score = dataGrid.selectedItem.score;
    dados.score_id = newVal;
    Alert.show(ObjectUtil.toString(dados));
           ]]>
        </mx:Script>
        <mx:TextArea id="cellInfo" width="300" height="150" />
                <mx:ArrayCollection id="arrcombo">
            <mx:source>
                <mx:Array>
                    <mx:Object label="1" data="A1"/>
                    <mx:Object label="2" data="A2"/>
                    <mx:Object label="3" data="A3"/>
                    <mx:Object label="4" data="A4"/>
                    <mx:Object label="5" data="A5"/>
                    <mx:Object label="6" data="A6"/>
                    <mx:Object label="7" data="A7"/>
                    <mx:Object label="8" data="A8"/>
                    <mx:Object label="9" data="A9"/>
                </mx:Array>
            </mx:source>
        </mx:ArrayCollection>
        <mx:ArrayCollection id="arrColl">
            <mx:source>
                <mx:Array>
                    <mx:Object label="Student A" score="8" />
                    <mx:Object label="Student B" score="4" />
                    <mx:Object label="Student C" score="7" />
                    <mx:Object label="Student D" score="8" />
                    <mx:Object label="Student E" score="2" />
                    <mx:Object label="Student F" score="6" />
                    <mx:Object label="Student G" score="7" />
                    <mx:Object label="Student H" score="7" />
                    <mx:Object label="Student I" score="9" />
                    <mx:Object label="Student J" score="8" />
                    <mx:Object label="Student K" score="4" />
                    <mx:Object label="Student L" score="7" />
                </mx:Array>
            </mx:source>
        </mx:ArrayCollection>
        <mx:DataGrid id="dataGrid"
                dataProvider="{arrColl}"
                editable="true"
                rowCount="8"
                itemEditEnd="getCellInfo(event);">
            <mx:columns>
                <mx:DataGridColumn dataField="label"
                        editable="false" />
                <mx:DataGridColumn dataField="score"
                        editable="true"
                        itemEditor="{combofac}"/>
    <mx:DataGridColumn headerText="Salvar" width="50">
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox width="100%" height="100%">
    <mx:Button label="See the values" click="outerDocument.mostra();"/>
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>

  • How to convert an array collection instance to a complex object for interaction with webservice

    Hi there,
    I have a stubborn problem that I am trying to work out the best way to solve the problem.  I am interacting with a WebService via HTTPService calling a method called find(String name) and this returns me a List of ComplexObjects that contain general string and int params and also lists of other Complex Objects.  Now using the code:
    ArrayCollection newOriginalResultsArray = new ArrayCollection(event.result as Array)
    flex converts my complex objects results to an arraycollection so that I can use it in datagrids etc.  Now up until this part is all good.  My problem is when getting a single instance from the results list, updating it by moving data around in a new datagrid for example - I want to interact with the webservice again to do an create/update.  This is where I am having problems - because these webservice methods require the complex object as a parameter - I am struggling to understand how I can convert the array collection instance back to my complex object without iterating over it and casting it back (maybe this is the only way - but I am hoping not).
    I am hoping that there is a simple solution that I am missing and that there is some smart cookie out there that could provide me with an answer - or at least somewhere to start looking. I guess if I have no other alternative - maybe I need to get the people who built the service to change it to accept an array - and let them do the conversion.
    Any help would be greatly appreciated.
    Bert

    Hi Bert,
    According to my knowledge you can use describeType(Object) method which will return an XML... That XML will contain Properties and values just iterate through the XML and create a new Object..   Probably u can use this method...
    public function getObject(reqObj:Object,obj:Object,instanceName:String,name:String=null,index:int=-1):Obj ect
                if(!reqObj)
                    reqObj = new Object();
                var classInfo:XML = describeType(obj);
                var className:String = instanceName;
                if(name!=null)
                    className=name+"."+className;
                if(index!=-1)
                    className=className+"["+index+"]";
                for each (var v:XML in classInfo..accessor)
                    var attributeName:String=v.@name;
                    var value:* = obj[attributeName]
                    var type:String = v.@type;
                    if(!value)
                        reqObj[className+"."+attributeName] = value; 
                    else if(type == "mx.collections::ArrayCollection")
                        for(var i:int=0;i<value.length;i++)
                            var temp:Object=value.getItemAt(i);
                            getReqObject(reqObj,temp,attributeName,className,i);
                    else if(type == "String" || type == "Number" || type == "int" || type == "Boolean")
                        reqObj[ className+"."+attributeName] = value; 
                    else if (type == "Object")
                        for (var p:String in value)
                            reqObj[ className+"."+attributeName+"."+p] = value[p];
                    else
                        getReqObject(reqObj,value,attributeName,className);
                return reqObj;
    Thanks,
    Pradeep

  • How To Populate An Advanced Data Grid In Flex With An XML Document Created In JAVA

    Flex Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="856" height="698" initialize="onInitData()">
        <mx:RemoteObject destination="utilityUCFlexRO" id="utilityUCFlexRO">
            <mx:method name="updateStationDetails" result="handleUpdateStationDetailsResult(event)" fault="handleUpdateStationDetailsFault(event)"/>
        </mx:RemoteObject>
        <mx:RemoteObject id="uniqueIdMasterUCFlexRO" destination="uniqueIdMasterUCFlexRO">
            <mx:method name="readByCustomerName" result="handleReadByCustomerNameResult(event)" fault="handleReadByCustomerNameFault(event)"/>
            <mx:method name="getCustomerAcDetails" result="handlegetCustomerAcDetailsResult(event)" fault="handlegetCustomerAcDetailsFault(event)"/>
        </mx:RemoteObject>
        <mx:Script>
            <![CDATA[
                import mx.events.ListEvent;
                import mx.collections.ItemResponder;
                import com.citizen.cbs.model.UniqueIdMaster;
                import mx.managers.PopUpManager;
                import mx.controls.ProgressBarMode;
                import mx.effects.Fade;
                import mx.controls.ProgressBar;
                import com.citizen.cbs.CitizenApplication;
                import mx.core.Application;
                import mx.messaging.messages.ErrorMessage;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.collections.ArrayCollection;
                import mx.controls.Alert;
                private var moduleCloseFlag:Boolean=false;
                private var v:UniqueIdMaster;
                [Bindable]
                private var customerDetails:ArrayCollection;
                [Bindable]
                private var branch:int=0;
                [Bindable]
                private var XMLDocument:XML;
                [Bindable]
                private var acDetails:XMLList;
                private var _progBar:ProgressBar = new ProgressBar();
                private function showLoading(e:Event = null):void
                    _progBar.width = 200;
                    _progBar.indeterminate = true;
                    _progBar.labelPlacement = 'center';
                    _progBar.setStyle("removedEffect", Fade);
                    _progBar.setStyle("addedEffect", Fade);
                    _progBar.setStyle("color", 0xFFFFFF);
                    _progBar.setStyle("borderColor", 0x000000);
                    _progBar.setStyle("barColor", 0x6699cc);
                    _progBar.label = "Please wait.......";
                    _progBar.mode = ProgressBarMode.MANUAL;
                    PopUpManager.addPopUp(_progBar,this,true);
                    PopUpManager.centerPopUp(_progBar);
                    _progBar.setProgress(0, 0);
                private function onInitData():void
                    utilityUCFlexRO.updateStationDetails(CitizenApplication.menuParameters["modulecode"]);
                private function handleUpdateStationDetailsResult(event:ResultEvent):void
                    if(moduleCloseFlag==true)
                        Application.application.unloadModule();
                private function handleUpdateStationDetailsFault(event:FaultEvent):void
                    var errorMessage:ErrorMessage = event.message as ErrorMessage;
                    Alert.show(errorMessage.rootCause.message);
                private function onSearch():void
                    if(txtName.text=="" || txtName.text==null)
                        Alert.show("Enter a name for search");
                        return;
                    if((txtName.text).length < 4)
                        Alert.show("Search should contain more than 3 alphabets");
                        return;
                    var d:String = txtName.text;
                    branch = CitizenApplication.initInfo.registeredUser.branchDetails.bdBranchNo;
                    uniqueIdMasterUCFlexRO.readByCustomerName(d,branch);
                    showLoading();
                private function handleReadByCustomerNameResult(event:ResultEvent):void                //In handle if record does not exists, dsiplays error message and resets the field
                    customerDetails =ArrayCollection(event.result);
                    PopUpManager.removePopUp(_progBar);
                    if(customerDetails.length==0)
                        Alert.show("Record Not Found, Enter Proper Name ");
                        onReset();
                private function handleReadByCustomerNameFault(event:FaultEvent):void
                    Alert.show(event.fault.faultDetail + " -- " + event.fault.faultString + "handleReadByCustomerNameFault");
                private function onReset():void
                    customerDetails=new ArrayCollection();
                    txtName.text="";
                private function onCancel():void
                    utilityUCFlexRO.updateStationDetails("MM0001");
                    moduleCloseFlag=true;
                private function btnBackClick():void
                    view1.selectedIndex=0;
                private function btnBackClick1():void
                    view1.selectedIndex=1;
                private function onItemClick( e:ListEvent ):void
                    if(dgCustDetails.selectedItem == null)
                        Alert.show("Select Proper Record");
                    else
                        lblId.text = e.itemRenderer.data.uimCustomerId;
                        lblName.text = e.itemRenderer.data.uimCustomerName;
                        var custId:int = Number(lblId.text);   
                        uniqueIdMasterUCFlexRO.getCustomerAcDetails(custId,branch);
                        showLoading();           
                private function handlegetCustomerAcDetailsResult(event:ResultEvent):void               
                    //XMLDocument = event.result as XML;
                    acDetails = new XMLList(event.result.menu);
                    //Alert.show("Name: "+event.result.@name);
                    PopUpManager.removePopUp(_progBar);
                    view1.selectedIndex=1;
                    //adg1.dataProvider=acDetails;
                private function handlegetCustomerAcDetailsFault(event:FaultEvent):void
                    PopUpManager.removePopUp(_progBar);
                    Alert.show(event.fault.faultDetail + " -- " + event.fault.faultString + "handlegetCustomerAcDetailsFault");
            ]]>
        </mx:Script>
        <mx:ViewStack height="688" width="856" id="view1">
            <mx:Canvas>
                <mx:Panel x="51" y="25" width="754" height="550" layout="absolute" title="Customer Search Page">
                    <mx:HBox x="174" y="26" horizontalAlign="center" verticalAlign="middle">
                        <mx:Label text="Enter Name:"/>
                        <mx:TextInput id="txtName" width="228"/>
                        <mx:LinkButton label="Search" click="onSearch()"/>
                    </mx:HBox>
                    <mx:Label text="--" id="lblId" x="40" y="194"/>
                    <mx:Label text="--" id="lblName" x="40" y="226"/>
                    <mx:DataGrid dataProvider="{customerDetails}" id="dgCustDetails" allowMultipleSelection="false" editable="false"
                        showHeaders="true" draggableColumns="false" width="718" height="373" itemClick="onItemClick(event);" x="10" y="61">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Customer Id" dataField="uimCustomerId" width="150"/>
                            <mx:DataGridColumn headerText="Customer Name" dataField="uimCustomerName"/>
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:ControlBar>
                        <mx:Button label="CANCEL" click="onCancel()" width="80"/>
                        <mx:Button label="RESET" click="onReset()" width="80"/>
                    </mx:ControlBar>
                </mx:Panel>
            </mx:Canvas>
            <mx:Canvas>
                <mx:TitleWindow x="10" y="10" width="836" height="421" layout="absolute">
                    <mx:AdvancedDataGrid x="6.5" y="10" id="adg1" designViewDataType="tree" variableRowHeight="true" width="807" height="278" fontSize="14">
                        <mx:dataProvider>
                              <mx:HierarchicalData source="{acDetails}"/>
                        </mx:dataProvider>
                        <mx:groupedColumns>
                            <mx:AdvancedDataGridColumn headerText="Type Of A/c" dataField="@Name" width="150"/>
                            <mx:AdvancedDataGridColumn headerText="Details Of A/c"/>
                        </mx:groupedColumns>
                        <mx:rendererProviders>
                            <mx:AdvancedDataGridRendererProvider id="adgpr1" depth="2" columnIndex="1" renderer="AcDetails1" columnSpan="0"/>
                        </mx:rendererProviders>
                    </mx:AdvancedDataGrid>
                    <mx:ControlBar height="56" y="335">
                        <mx:Button label="BACK" width="80" click="btnBackClick()"/>
                        <mx:Spacer width="100%"/>
                        <mx:Button label="EXIT" click="onCancel()" width="80"/>
                    </mx:ControlBar>
                </mx:TitleWindow>
            </mx:Canvas>
        </mx:ViewStack>
    </mx:Module>
    XML File Generated In JAVA:
    <?xml version="1.0" encoding="UTF-8"?>
    <menu>
    <AcType Name="Savings">
    <SavingAcDetails AcName="Mr. MELROY BENT" AccountNo="4" ClearBalance="744.18" ProductID="SB" TotalBalance="744.18">
    <SavingMoreAcDetails AcStatus="OPERATIVE" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="AnyOne Single Or Survivor"/>
    </SavingAcDetails>
    </AcType>
    <AcType Name="TermDeposit">
    <TDAcDetails AcName="Mr. BENT MELROY" AccountNo="1731" ProductID="TD">
    <TDMoreAcDetails AcStatus="OPERATIVE" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="Either or Survivor"/>
    </TDAcDetails>
    <TDAcDetails AcName="Mr. BENT MELROY" AccountNo="2287" ProductID="TD">
    <TDMoreAcDetails AcStatus="NEW" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="Self"/>
    </TDAcDetails>
    <TDAcDetails AcName="Mr. BENT MELROY" AccountNo="78" ProductID="TD">
    <TDMoreAcDetails AcStatus="OPERATIVE" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="Self"/>
    </TDAcDetails>
    </AcType>
    </menu>
    Tried Alot Of Examples Online But In Vain....
    Need Help....
    Thanks In Advance....

    Please help me !!!! I have been stuck up with this issue for the past two days and I need to atleast figure out if this is possible or not in the first place.

  • Variable instantiation not working

    Hello all,
    I have the most weird problem: Inside a custom component
    based on list, I'm getting an arrayCollection from a RemoteObject,
    and after I want to create a new array where I set (in the client)
    which elements are, or are not selected). In the first iteration of
    coding (just trying to create a new array without any problems), I
    instantiate a variable, but the reference is still null!!!
    So, rewind, and focus on the single problem: I create a
    variable, using new FollowUpCardActionVO(), and still I get a null
    reference.
    More bizarre is that, actually, I can access the members in
    the created object, but when trying to add it to an array
    collection, I get the error: "TypeError: Error #1009: Cannot access
    a property or method of a null object reference."
    The buggy part of the code follows:
    var tmpSpActionTypesList:ArrayCollection = event.result as
    ArrayCollection;
    var tmpFollowUpCardActionVO:FollowUpCardActionVO = new
    FollowUpCardActionVO();
    for (var i:int=0; i < tmpSpActionTypesList.length; i++) {
    Debug.println("Adding new FollowUpCardActionVO() ["+i+"]");
    Debug.println("Setting ActionId: " + tmpSpActionTypesList
    .actionId);
    Debug.println("Setting ActionToken: " +
    tmpSpActionTypesList.actionToken);
    tmpFollowUpCardActionVO.actionId = tmpSpActionTypesList
    .actionId;
    tmpFollowUpCardActionVO.actionToken =
    tmpSpActionTypesList.actionToken;
    tmpFollowUpCardActionVO.selectedCheckBox = false;
    Debug.println("Item created: " +
    tmpFollowUpCardActionVO.toString());
    spActionTypesList.addItem(tmpFollowUpCardActionVO);
    When addingItem, the error is displayed, if I instantiate a
    new object at every iteration of for same thing happens. the
    console output is as follows :
    [AS DEBUG] Adding new FollowUpCardActionVO() [0]
    [AS DEBUG] Setting ActionId: 16
    [AS DEBUG] Setting ActionToken: Help user
    [AS DEBUG] Item created: null
    :: actionid 16
    :: actionTokenHelp user
    :: selectedCheckBoxfalse
    and the VO class:
    package valueObject.followUpCard
    import mx.collections.ArrayCollection;
    * Manage Data to transfert beetwwen Java and AS.
    * Contains Card Status elements
    * @author dro
    public class FollowUpCardActionVO
    * Action Type Identifier
    public var actionId:int;
    * Action Token
    public var actionToken:String;
    * flag to be used in the card action type listBox
    public var selectedCheckBox:Boolean=false;
    * Constructor
    public function FollowUpCardActionVO() {
    super();
    public function toString():String {
    var toString:String;
    toString += "\n" + ":: actionid " + actionId;
    toString += "\n" + ":: actionToken" + actionToken;
    toString += "\n" + ":: selectedCheckBox" + selectedCheckBox;
    return toString;
    Thanks, any help would be appreciated... I can work around
    it, but also would like to figure out what's happening!

    I note that your toString method on FollowUpCardActionVO is
    declaring a new string toString, but not setting a value. You then
    proceed to append strings to it. In other words the first string
    assignment is:
    toString += "\n" + ":: actionid " + actionId;
    which is analogous to
    toString = null + "\n" + ...
    I expect this is why your toString is returning null in your
    debug message. It's also hazardous to shadow your toString method
    by declaring a local variable by the same name, though that won't
    confuse the compiler - just exposes you to errors.
    The reason it appears you're getting the error on the add is
    that your collection has never been initialized - as Tracy noted in
    her first response, you don't initialize spActionTypesList.
    If tmpFollowUpCardActionVO were really null, you wouldn't be
    able to invoke its toString method :)

  • Issues in mapping objects from java to flex - using flex4

    Hi,
    I have a class in java which i want to send to flex4 using BlazeDS as middleware. There are a few issues that i am facing and they are:
    When sending the object across (java to flex), the properties with boolean data type having value as true gets converted to properties with value as  false. Even after setting the value to true it still comes as false on flex side. Can't understand why this is happening.
    When sending the list of object containing property with boolean data type, the object on flex side does not show those properties at all. As of there were no boolean properties in that object.
    Last but not the least, When sending List<ContractFilterVO> contractFilterVOs to flex using remote call, the result typecasted to ArrayCollection does not show the holding objects as ContractFilterVOs but as plain default Object though having all the properties send, except the boolean one mentioned in above points. Basically it is not able to typecast the objects in arraycoolection but the same objects gets typecasted when sent individually.
    In all the above points i am using Remote Service through BlazeDS for connectivity with Java. I have done a lot of this stuff in Flex 3 but doing it for the first time in flex 4, is there anything that Flex 4 needs specific. Below is the pasted code for reference purpose.
    Flex Object
    package com.vo
         [RemoteClass(alias="com.vo.ContractFilterVO")]
    public class ContractFilterVO{
         public function ContractFilterVO(){
         public var contractCode:String;
         public var contractDescription:String;
         public var isIndexation:Boolean;
         public var isAdditional:Boolean;
    * Rmote Part of code
    var remoteObject:RemoteObject = new RemoteObject();
    remoteObject.destination="testService";
    remoteObject.addEventListener(ResultEvent.Result,handleResult);
    public function handleResult(event:ResultEvent):void{
         var contarctFilterVOs:ArrayCollection = event.result as ArrayCollection; //Point 2&3 probelem, if list sent form java
         var contarctFilterVO:ContractFilterVO= event.result as ContractFilterVO; //Point 1 probelem, if only single Object of type ContractFilterVO sent form java
    Java Object
    package com.vo
    public class ContractFilterVO implements Serializable 
         public function ContractFilterVO(){
         private static final long serialVersionUID = 8067201720546217193L;
         private String contractCode;
         private String contractDescription;
         private Boolean isIndexation;
         private Boolean isAdditional;
    I don't understand what is wron in my code on either side, it looks syntactically right. It would be great anyone could help me point out my mistake here. Waiting for right solutions...
    Thanks and Regards,
    Jigar

    Hi Jeffery,
    Thanks for your reply, it did solve my query @ point 3 as well as point 2 where the objects in arraycollection were not geting converted and boolean properties did not appear when list of an objects were received. And hey, i did have public functions for properties defined java class, just forgot to mention here in post, sorry for that.
    The solution you gave was right, but than what if i have a VO which has multiple List of objects coming from Java, than i would have to create an instance of each type of object on flex side this is too tedious, is'nt it? Is there any better solution... out there.
    And jeffery do you some tricks up your sleeve for this Boolean issues to that i am facing in point 1... Still struggling with this one...
    Anyone out there would be more than welcome to point my mistake, if any and provide tips/tricks or solutions...
    Thanks again to Jeffery...
    Waiting for more solutions sooner...
    thanks and Regards,
    Jigar

Maybe you are looking for