Fill() return empty ArrayCollection collection

Hello

I'm new to SDS and do not know why the fill() method returns nothing, even if the assembler returns a list of 3 items. I know the list is back nothing because when I see the length of the ArrayConnection, it is 0.

I'm Tournai on the debugging logs and see the 3 items returned. Do you have tips on how I can solve this problem?

Is there somewhere in the configuration where I specify the Java class maps to ActionScript class B? I just deleted my corresponding ActionScript class and always the same newspapers. I suspect that the SDS does not know how to map the Java class in the ActionScript class so that it gives me an empty list and throws the results. Does this sound right? If there is some sort of automatic mapping, I was expecting to see an error in the log after I deleted the ActionScript class.

Thank you
Jamie

[Flex] 18/05/2007 12:19:31.443 [DEBUG] [DataService.Transaction] committed trans
action
[Flex] 18/05/2007 12:19:31.443 [DEBUG] [Message.Data.fill] after calling a service:
data service
answer: Flex Message (flex.data.messages.SequencedMessage)
sequenceId = 0
sequenceSize = 3
(no proxy sequence)
clientId = null
correlationId = null
destination = company
messageId = 7A2A0D8F-C32B-80BC-D593-4551B71320F1
timestamp = 1179515971443
timeToLive = 0
body =
[
Company (companyId = 100, name = null, address = null, status = null, zip = null undue
Try = null),
Company (companyId = 101, name = null, address = null, status = null, zip = null undue
Try = null),
Company (companyId = 102, name = null, address = null, status = null, zip = null undue
Try = null)
]

I found the answer to my own question. It was just a race condition. You can not read the size of the ArrayCollection collection immediately. The list takes some time to complete.

Tags: Adobe LiveCycle

Similar Questions

  • Singleton empty ArrayCollection in Flashbuilder (Mobile) collection class?

    Hello

    I am currently trying to implememnt a Singleton class to store a collection of ArrayCollection of items that I can then access and manipulate through the lifecycle of my application. I created the Sub Singleton class that is designed to receive the ArrayCollection collection information:

    package valueObjects
    {
        import mx.collections.ArrayCollection;    
        
        [Bindable]
        public class Model
        {
            private static var instance:Model = new Model();
            
            public var ids:ArrayCollection = new ArrayCollection();
                                    
            public function Model()
            {
                if(instance)
                {
                    trace("New instance cannot be created. Use Singleton.getInstance()");
                }
            }
            
            public static function getInstance():Model
            {
                return instance;
            }
        }
    }

    I then created the following code on the main page Deafult to my request so that the ArrayCollection collection is filled as soon as the application is launched:

                import valueObjects.Model;            
                
                protected var models:Model = new Model();
    
                            private function loop():void
                {
                    var index:int;
                    for( index = 0; index < compsCollection.length; index++ )
                    {
                        trace( "Element " + index + " is " +  compsCollection[index].comp_id );
                                    models.ids.addItem(compsCollection[index].comp_id);
                        trace(models.ids.length);
                    }                
                }
    

    The ArrayCollection collection in the Singleton class is filled as the trace instruction that I entered the loop clearly shows the generation of data in the ArrayCollection collection. But then when I move to another view of the application I then try to access this ArrayCollection collection within the Singleton class with the following code:

    import valueObjects.Model;
    
    protected var models:Model = Model.getInstance();
    protected var test:ArrayCollection = new ArrayCollection();
    
    protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
                {
                    
                    var index:int;
                    trace("Array Length =" + models.ids.length);
                    for( index = 0; index < models.ids.length; index++ )
                    {
                        trace( "Element " + index + " is " + models.ids[index].comp_id );
                        test.addItem(models.ids[index].comp_id);
                    }    
                    testbox.text = test.toString();
                }
    

    Now the problem I have is that when I try to access this ArrayCollection (ids), it seems to be empty for some reason any. I've included a trace statement that also indicates that the length of the ArrayCollection collection is '0 '. Can someone please help?

    If your value object class changes that

    change this

    public var ID: collection ArrayCollection = new ArrayCollection();
    TO

    public static var ids:ArrayCollection = new ArrayCollection();
    

    on your default page to change it

    models.ids.addItem (compsCollection [index] .comp_id);

    TO

    valueObjects.Model.ids.addItem(compsCollection[index].comp_id);
    

    on your display something like that change.

    protected
    
     function view1_viewActivateHandler():void
              {
                   //initialize="view1_viewActivateHandler();"
                   var index:int;
                   trace("Array Length =" + valueObjects.Model.ids.length);
                   for( index = 0; index < valueObjects.Model.ids.length; index++ )
                   {
                        trace( "Element " + index + " is " + valueObjects.Model.ids[index].comp_id );
                        test.addItem(valueObjects.Model.ids[index].comp_id);
                   }
                   //testbox.text = test.toString();
              }
    

    good luck let me know if you have any questions I have tested it and it worked like a charm for me.

    Miguel

  • Returns an ArrayCollection from PHP collection

    Hey everybody. I'm playing with the Flex RemoteObject class. I inserted with success of data in a database. Now, I try to recover the data and set the result as a dataProvider to a DataGrid component or list. I used Charles to check if I get all the data at all, and I found that everything works fine except that I'm getting a table and not an ArrayCollection collection. I tried casting the result inside Flex, but that did not work, makes it even DataGrid empty... any suggestions?

    Here is my PHP function:

    public void getUsers()

         {

    $sql = "SELECT * FROM USERS";

    $res = mysql_query ($sql);

    $params = array();

    while ($row < mysql_fetch_array ($res))

              {

    $user = new VOUser;

    id-> $user = $row ['id'];

    $user-> name = $row ['name'];

    $user-> name = $row ['name'];

    $user-> email = $row ['email'];

    $user-> password = $row ["password"];

    -> company $user = $row ['company'];

    $user-> phone = $row ["phone"];

    $user-> fax = $row ['fax'];

    $user-> job_position = $row ["job_position"];

    $user-> Web site = $row ["Web site"];

    $user-> vat_number = $row ["vat_number"];

    $user--> ip_address = $row ["ip_address"];

    $params [] = $user;

              }

    mysql_free_result ($res);

    return $params;

         }

    While ($row = mysql_fetch_object ($result))

    {

    $tmp = new valueObject();

    $tmp-> name = $row-> name;

    etc...

    etc...

    [$processedResult] = $tmp;

    }

    Return $processedResult;

  • ArrayCollection collection do not fill after calling first Data Services

    I am filling a collection ArrayCollection using a call for data by the following code:

    [
    Bindable]
    
    public var srv:RemoteObject;
    
    var acCountries:ArrayCollection; 
    
    if
    
    
     (srv == null){srv = 
    new RemoteObject();srv.destination = 
    
    "trip"; }
    acCountries = srv.getAllCountries.lastResult;
    srv.getAllCountries();
    
    
    
    

    ArrayList is not populted during the first call.  The java backend data service method is called, but the ArrayCollection collection is not populated until the time of the second (or third) the code is executed.

    I tried to walk through the debugger, but it is unclear what I does not initialize correctly.

    Hello

    Try to use the below approach instead of the adopted approach.

    [

    Bindable]

    public var srv:RemoteObject;

    private function getAllCountries():void

    {

    var acCountries:ArrayCollection;

    if (srv is Nothing)

    {

    SRV =

    new RemoteObject;

    SRV.destination =

    'journey';

    }

    srv.addEventListener (ResultEvent.RESULT, countriesResultHandler);

    srv.addEventListener (FaultEvent.FAULT

    countriesfaultHandler);

    srv.getAllCountries ();

    }

    private function countriesResultHandler(result:ResultEvent)

    {

    Check here the result by debugging object and replace the threshold accordingly

    acCountries = result.countries;

    }

    private function countriesfaultHandler(fault:FaultEvent)

    {

    Alert.Show)

    "Error: ' + fault.message);

    }

    In the approach you used you bind the data to the ArrayCollection collection by making use of the lastResult object.

    But you use the below line and send the result at the same time...

    acCountries = srv.getAllCountries.lastResult;

    srv.getAllCountries ();

    Here you don't know when the acCountries arraycollection collection will be linked to the lastResult object. Given that it is an asynchronous operation for the first time that you control the acCountries arraycollection collection you have all the data. Her approach always better and good use of event handlers in response as the way I used so that you will know exactly when took place the answer/result and if no fault or so.

    If this post answers your question or assistance, please mark it as such.

    Hope this will make things clear...

    Thank you

    Jean Claude Chari

  • fill combobox via rpc and arraycollection collection

    Hello

    I have this XML coming via httpservice.

    < types >
    < type >
    < TypeId > 1 < / TypeId >
    < TypeUitspraak > Vonnis < / TypeUitspraak >
    < / type >
    < type >
    < > 2 TypeId < / TypeId >
    Arrest of < TypeUitspraak > < / TypeUitspraak >
    < / type >
    < / types >

    Here's (part of) the code

    Import mx.collections.ArrayCollection;
    Mx.rpc.events import. *;


    [Bindable]
    private var uitspraakTypes:ArrayCollection;

    private void typesHandler(event:ResultEvent):void {}
    uitspraakTypes = event.result.types.Type;
    }


    private function InitApp (): void
    {
    types. Send();
    }


    "" < mx:HTTPService id = 'types' url = ' http://www.emis.vito.be/SBO/haaltypes.asp ' result = "typesHandler (event)" / >

    < mx:ComboBox id = "typeUitspraak" dataProvider = "{uitspraakTypes}" > < / mx:ComboBox >


    in debugging mode in that I can see the arraycollection collection correctly filled
    I want to bind TypeUitspraak node of the xml to a combobox.
    I get [object Object] in my combobox.

    Please tell me what I'm missing here.

    Thank you

    Karel

    Hello
    You ares is simply not enough the only important thing

    ComboBox uses a property called labelfield to show your domain, you must pass a dataprovider and your arraycollection collection a labelfield, in your case TypeUitspraak of penny

  • How to raise an event from the arrayCollection collection?

    I'm passing data from a model to a view in the following files. It works fine, but I want to send a message on the screen when an arrayCollection collection is filled. I know that I could create a custom event, but I do not understand why the eventhandler I created will not work. Please tell me what I'm doing wrong.

    Thank you.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"creationComplete =" init () "> "
    < mx:Script >
    <! [CDATA]
    Import mx.collections.ArrayCollection;
    Import mx.events.CollectionEvent;
    Import mx.rpc.events.ResultEvent;
    [Bindable] private var databaseDataArrayCollection:ArrayCollection = new ArrayCollection collection;
    [Bindable] private var: model = new modele();
    [Bindable] private var: controller = new Controller();
    private function init (): void {}
    model.databaseDataArrayCollection.addEventListener (CollectionEvent.COLLECTION_CHANGE, chan ge)
    model = Model.createInstance ();
    controller.getData ();
    }
    private void change(e:Event):void {}
    trace ("changed in sight")
    }
    []] >
    < / mx:Script >
    < mx:DataGrid dataProvider = "{model.databaseDataArrayCollection}" > "
    < mx:columns >
    < mx:DataGridColumn id = "first name" dataField = "first name" headerText = "FIRSTNAME" / >
    < mx:DataGridColumn id = "lastName" dataField = "lastName" headerText = "LAST NAME" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / mx:Application >

    Model.As

    package {}
    Import mx.collections.ArrayCollection;
    [Bindable]
    public class {model
    public var databaseDataArrayCollection:ArrayCollection = new ArrayCollection();
    private static var: model = new model;
    private static var num:Number = 0;
    public void modele() {}
    }
    Public Shared function createInstance (): model {}
    NUM ++
    if(Model == null) {}
    model = new modele();
    }
    return the template;
    }
    }
    }

    Controller.As

    package {}
    import com.simon.cms.UrlString;

    import flash.events.Event;

    Import mx.collections.ArrayCollection;
    Import mx.events.CollectionEvent;
    Import mx.rpc.events.ResultEvent;
    Import mx.rpc.http.HTTPService;
    Import mx.utils.StringUtil;

    [Bindable]
    public class {controller
    private var: model = new modele();
    public var httpService:HTTPService = new HTTPService;
    private var login_string:UrlString = new UrlString();
    public void Controller() {}
    model = Model.createInstance ();
    }
    public void getData (): void {}
    var params: Object = new Object();
    httpService.url = login_string.login;
    httpService.method = "GET";
    httpService.addEventListener (ResultEvent.RESULT, extractData);
    httpService.send (params)
    }
    private void extractData(event:ResultEvent):void {}
    httpService.removeEventListener (ResultEvent.RESULT, extractData);
    model.databaseDataArrayCollection.addEventListener (CollectionEvent.COLLECTION_CHANGE, chan ge)
    model.databaseDataArrayCollection = event.result.student.task;
    }
    private void change(e:CollectionEvent):void {}
    trace ("Changed in the collection")
    }
    }
    }

    You use "=" this is a reversal/replacement.  There is no chip

    assignment that will update.

    You could do

    model.databaseDataArrayCollection.source =

    Event.Result.Student.Task.source;

    That should translate into a CollectionEventKind.RESET in original HQ as it

    now a new set of data.

  • Extract information from the arrayCollection collection

    Hello world

    I have a very simple problem, but I'm a new flex developer and I have no idea what to do.

    that I extracted information from a database by using a Web service in coldfusion.

    in flex, I recovered my query result in an arrayCollection collection

    private var tabInfosDriver:ArrayCollection

    Private function driverInfoHandler(event:ResultEvent):Sub

    tabInfosDriver = event.result as ArrayCollection; collection

    and if I give {tabInfosDriver} as a dataprovider to a DataGrid, the result of the query is displayed correctly, something like that.

    Header1 By tete2 Header3 Header4 Header5
    someValuevalue2someValue3someValue4someValue5


    now, I want to use header1 someValue to fill a textField instance.

    I tried:

    Label1.text = tabInfosDriver.getItemAt (1.0) m:System.NET.SocketAddress.ToString)

    but it wrong: the index table out of range and in any case, I want to use the name of the header field, which is the database table to call its value

    Label1.text = tabInfosDriver.getItemAt("header1").value.toString)

    What can I do? I don't know that it is easy to solve. I looked at all the methods of the collection arrayCollection object, but I can't understand wich one to use.

    Please forgive me of my language, I do not speak English very often.

    Dominic

    Often you can either return the data to the Flex application in standard object notation, or to reconfigure the data in this way once he returns to the Flex application in the result handler. The standard notation, to which I am referring is:

    {

    {key1: 'value 1', key2: "Value2", key3: "Value3"},

    {key1: 'value 1', key2: "Value2", key3: "Value3"},

    {key1: 'value 1', key2: "Value2", key3: "Value3"},

    {key1: 'value 1', key2: "Value2", key3: "Value3"}

    }

    So in this way the data is structured, already as an associative array, because such a table is really just an ActionScript object.

    If these data should be accessible in two ways:

    var tempVar:String = myObject.key1;

    var tempVar:String = myObject ["key1"];    (maybe myObject ["key1"])

    Moreover, this "standard object notation" is also known under the name of JSON and there are libraries for handling JSON to the format of the data in Flex, PHP, etc if you have not necessarily to treat it as JSON, which comes, which makes it a little more formal and provides additional APIs:

    http://code.Google.com/p/AS3corelib/

  • Variable HTTService and ArrayCollection collection

    First of all - thanks for these turorials - great they´re.
    But as a beginner is easy to do something wrong.
    If I always appreciate the code source, so we can accelerate the learning one curve don't fight
    with small details like many empty spaces on etc...

    I ve done the exercise with HTTService again and again.
    I have debugging and all this, disable all firewall but still cant able to load the xml file into the DataGrid.
    Files and directories are accurate as in your tutorials.
    But only a blank page, I posted

    Here´s that the debbuger says:
    ".. Cannot convert mx.utils::ObjectProxy@29d1ee1 in mx.collections.ArrayCollection. »

    Probably what could be wrong?


    Here´s code:

    Hello highlander_1,

    I managed to get your example working with a few changes. I datatyped employeeData as XMLListCollection and adds the resultFormat property in the HTTPService e4X. The collection and E4X XMLList will allow you easily fill the dataGrid control. To see in the code below, I used

    Quote:

    The dataField property is the tag in the XML file. The headerText property is what is called the column. You can add several of them. In the example, I have edited for you, I see that three (firstname, lastname, email).

    You receive the data type ObjectProxy in castant don't not the ArrayCollection collection. For example:

    Quote:
    myDataStuff = event.result.employee as ArrayCollection collection;

    In this application, I copied your XML file in my project in a folder of data, here is the file of the application:

    Quote:

    http://www.Adobe.com/2006/mxml"layout ="absolute ".
    creationComplete = "init ()" > "


    Import mx.collections.ArrayCollection;
    Import mx.collections.XMLListCollection;
    Import mx.rpc.events.ResultEvent;

    [Bindable]
    private var employeeData:XMLListCollection = new XMLListCollection();

    private function init (): void
    {
    employeeService.send ();
    }

    private void resultHandler(event:ResultEvent):void
    {
    We're going to wrap the source with the XMLList.
    var employeeResultData:XMLList = new XMLList();
    employeeResultData = event.result.employee;
    employeeData.source = employeeResultData;
    }

    ]]>



    result = "resultHandler (Event)" resultFormat = "e4x" / > "



    dataProvider = "{employeeData}.
    Width = "480" >






    Hope this helps you,

    Ryan

  • Add the object to the ArrayCollection collection

    Hi all

    I have an ArrayCollection collection which will be filled by a call remotely from java code.

    The Collection is no longer bound to a ComboBox that is shownup in the Panel.

    I tried to add an object to the collection of ArrayCollection iterated to 0th Index, whereas I could see this label of objects as the default label in the drop-down list box.

    But when the drop-down list box is displayed, the first element of the returned list of JavaCode is shown as the default label.

    See all present items in the drop-down list box, the label of objects which is added at Index 0 is seen, but when rendering this is not used as the default when appears on the display.

    < mx:ArrayCollection id = "departments" / >

    private void departmentResultHandler(event:ResultEvent):void
    {
    departments = event.result as ArrayCollection collection;
    Department: Department of var = new Department();
    department.departmentID = 0;
    department.departmentName = "Department";
    departments.addItemAt(department,0);
    }

    < mx:ComboBox id = "add_departmentID" dataProvider = "{services}" labelField = "departmentName" textAlign = "left" selectedIndex = "0" / >

    As I can't download images screeshot here, these are the URL that displays the images and gives a clear picture of what explains

    http://picasaweb.Google.com/narra.Madan/screenshots/photo#5118474206291402818

    http://picasaweb.Google.com/narra.Madan/screenshots/photo#5118474206291402834

    Please suggest where I have gone wrong

    Kind regards
    Madan

    The problem is the timing. When you assign the event.result to departments, the result is bound to the drop-down list, and the first item is selected by default. When new items are added to the drop-down list, flex does not change the selected item to the new item. Yes, it's just saying to your drop-down list box to select the element 0 and it will show Department.

    departments.addItemAt(department,0);
    add_departmentID.SelectedIndex = 0;

    You can also look at the use of the prompt property of the combo box. The prompt when comboBox.selectedIndex = - 1. Unless you need article of the Jet to be selectable, you can quickly define = 'Department' and then do:

    private void departmentResultHandler(event:ResultEvent):void
    {
    departments = event.result as ArrayCollection collection;
    add_departmentID.SelectedIndex = - 1;
    }

    Vygo

  • collection ArrayCollection collection arraycollection assigned values from the original setting?

    Hi... I am pretty stumped on this one. Here's the situation... on my main flex app I define an arraycollection collection:

    public var fiscalYrsArray:ArrayCollection;

    The collection is filled with the results of a query to a CFC

    protected function fiscalYrs_resultHandler(event:ResultEvent):void {}

    for (var x: int = 0; x < event.result.length; x ++) {}

    If (event.result [x]. DATA == passData.filterFiscalYrs) {}

    Event.Result [x]. Assigned = true;

    }

    }

    fiscalYrsArray = event.result as ArrayCollection collection;

    }

    I have a main application with drop-down menus window (I use a multi-case combobox). I use this window as a filter window, where users can choose what they want filtered.

    on this component, I use a temporary arraycollection collection (b/c I don't want to change the assignments of the arraycollection the temp collection is based off of) which will be a copy of the fiscalYrsArray of the parentApplication collection:

    " < = xmlns:fx s:TitleWindow ' http://ns.Adobe.com/MXML/2009 'close = "PopUpManager.removePopUp (this)'

    xmlns:s = "library://ns.adobe.com/flex/spark" title = "filter data" creationComplete = "initComp (); »

    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "400" height = "300".

    xmlns:multiPickBox = "Components.multiPickBox. *" >

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >

    < / fx:Declarations >

    < fx:Script >

    <! [CDATA]

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import mx.managers.PopUpManager;

    private var tempfilterFiscalYrs:String

    [Bindable] private var fiscalYrDP:ArrayCollection = new ArrayCollection collection;

    private function initComp (): void {}

    fiscalYrDP = parentApplication.fiscalYrsArray;

    tempfilterFiscalYrs = parentApplication.passData.filterFiscalYrs;

    }

    protected function msc_addItemHandler(event:Event,filterVal:String,comboId:String):void

    {

    Alert.Show ("get here '");

    This [filterVal] = ";

    {for each (var point: Object in {this [comboId] .selectedItems)}

    This element of += [filterVal] ['DATA'] + ",";

    }

    filterChange = true;

    idText.text = str;

    }

    I am lie the collection arraycollection filterYrDP to a custom choice multi combobox:

    < multiPickBox:CheckCombo id = "fiscalYearF" width = "162" dataProvider = "{fiscalYrDP}".

    addItem = "msc_addItemHandler (event, 'tempfilterFiscalYrs', 'fiscalYearF')" "

    allIndex = '0' x = "77" y = "17" labelField = "DATA" / >

    However, I find that when an element is activated the assigned = true value is actually applied to the fiscalYrsArray of my parentApplication origin. I just want the assigned = true to apply to the fiscalYrDP collection arraycollection (one that is based on the fiscalYrsArray of parentApplication). How could it be written back and changing the properties of a fi main is just a temporary copy?

    By assigning the table using "=" you are just assigning the same table - in the same memory location.

    If you want to keep a separate table, you use the function ObjectUtil.copy

    import mx.utils.ObjectUtil;
    
    arrNewData  = new ArrayCollection();
    arrOldData  = ObjectUtil.copy(arrNewData) as ArrayCollection;
    
  • Type was not found or was not a compilation constant: ArrayCollection collection

    I've never seen this type of error before. I was running the asdoc tool when I arrived at the Office:

    package adventureGame.util
    {
         import mx.collections.ArrayCollection;
    
         public class ACConvertor
         {
              public function toAC(array:Array):ArrayCollection
              {
                   var arrayObject:Array = new Array();
                   var ac:ArrayCollection = new ArrayCollection();
                   
                   return ac = arrayObject as ArrayCollection;
              }
         }
    }
    

    Why I get:

    ACConvertor.as (31): col: 37 error: Type was not found or is not a constant of compilation: ArrayCollection collection.

    public void toAC(array:Array):ArrayCollection

    Collection ArrayCollection and any class that starts with mx... is that the Flex code. You work in an IDE Flex or Flash?

  • Cast of XML for the ArrayCollection collection where there is a single record

    I work with web services and in the result handler doing the following

    protected function WbSc_SSPr_PrinterListResult_resultHandler(event:ResultEvent):void
    {
    printerlistArrayCollection = event.result.Printer as ArrayCollection collection;
    PrinterCount = printerlistArrayCollection.length - 1;
    }

    If there is more than one value it works fine.

    If only one value is returned, then it shows as nothing.

    Huh?

    When I run it as a test, it returns a record

    <? XML version = "1.0" encoding = "UTF-8"? >
    < SOAP - ENV:Envelope
    " SOAP - ENV:encodingStyle = ' http://schemas.xmlsoap.org/SOAP/encoding/ "
    " xmlns:SOAP - ENC =" http://schemas.xmlsoap.org/SOAP/encoding/ "
    " xmlns:SOAP - ENV =" http://schemas.xmlsoap.org/SOAP/envelope/ "
    " container = ' http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">
    < SOAP - ENV:Body >
    " < = xmlns:ns1 ns1:WbSc_SSPr_PrinterListResponse ' http://www.4d.com/namespace/default ">
    < BidList xsi: type = "xsd: anyType" >
    < printer >
    Cognititve < do > < / make >
    ZB345 < template > < / template >
    < problem > This IS a TEST PROBLEM < / problem >
    < / printer >
    < / BidList >
    < / ns1:WbSc_SSPr_PrinterListResponse >
    < / SOAP - ENV:Body >
    < / SOAP - ENV:Envelope >

    Probably something like this will do:

    If (event.result.Printer is collection ArrayCollection) {}

    printerlistArrayCollection = event.result.Printer as ArrayCollection collection;

    } else {}

    printerlistArrayCollection = new ArrayCollection ([event.result.Printer]);

    }

  • Object to an ArrayCollection collection

    Hello

    I have an application that supports some info from database and he sinks into a datagrid, or a chart.

    I met this error to have one line and try to use it in a table so that I can use in my application.  Its come to my attention that it is a quite common problem that people face, but I don't seem to be able to get around any one test.

    My actionscript has a function that trots through ASP database and returns the data in the case - as below (obv I deleted stuff - load of calls are made to the mssqlQuery function - the only one I have trauma with is below)

    mssqlQuery ("SELECT (CASE SLARag, COUNT (SLARag) as Volume [CMI_ClientMI]. [Portal]. [BatchUpdate]","BusSegBuildSummary") ;}

    public static void mssqlQuery(sql:String,fid:String):void {}

    var http:HTTPService = new HTTPService;

    var parm:Object = new Object;

    parm.fas_sql = sql;

    parm.fas_db = mssql_db;

    http.url = mssql_url + "? irand =" + Math.random ();

    http.showBusyCursor = true;

    http.request = sql;

    http.addEventListener (ResultEvent.RESULT, mssqlResult);

    http.addEventListener (FaultEvent.FAULT, mssqlFault);

    http.method = "POST";

    sqlToken = http.send (parm);

    sqlToken.param = fid;

    }

    For BusSegBuildSummary collection arraycollection var

    [Bindable]

    public static var _BusSegBuildSummary:ArrayCollection = new ArrayCollection();


      

    Case statement to BusSegBuildSummary

    case 'BusSegBuildSummary':

      


    If (event.result.results.record is ObjectProxy) {}

    trace ("this is a Proxy object");


    }

    else {}

    trace ("it isn't Proxy object");

    _BusSegBuildSummary = event.result.results.record;

    }

    break;

    So - if the result has several records in it - so we are very well - it's the trace ("this is Proxy object"); bit which is annoying.

    I think I have to send the object as an arraycollection collection and I tried a number of different ways without success.

    Any ideas? I struggled for a while now and I am panicing!

    Hi Andrew

    No problem with the warranty so I wanted just report to disseminate good practices

    I do not understand what you write, but it is how I read it:

    When the user runs the function again, you get a more added slice, you can don't wan't, only you don't wan't the new?

    This is because you don't collection.addItem (item), so just add the to it to the collection.

    If you need to do:

    If (event.result.results.record is ObjectProxy)

    {

    collection.removeAll ();

    collection.addItem (event.result.results.record)

    }

    Best regards

    Martin

  • Labelling of records in an array or arrayCollection collection

    Many of the Tour de Flex examples use a table in a way that is not familiar to me. For example: var array: Array = [{Profit: 2000}, {Profit: 2400}];

    I want to put my data in the table as follows: var array1:Array = [2000,2400];

    but I still want to be able to access the property of 'Profit' when I use an ArrayCollection collection as in the example below.

    So, I have 2 questions:

    First of all, what is the name given to filling a table like: var array: Array = [{Profit: 2000}, {Profit: 2400}];

    and

    Second, how to tag my data with "Profit" when I add it to an array or ArrayCollection collection?

    Thanks for your time.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "creationComplete ="init ()">
    < mx:Script >
    <! [CDATA]
    Import mx.collections.ArrayCollection;
    private function init (): void {}
    var array: Array = [{Profit: 2000}, {Profit: 2400}];
    var ac0:ArrayCollection = new ArrayCollection (array);
    areachart.dataProvider = ac0;
    //
    var array1:Array = [2000,2400];
    var ac1:ArrayCollection = new ArrayCollection (array1);
    areachart1. DataProvider = ac1;
    }
    []] >
    < / mx:Script >
    < mx:Panel >
    < mx:AreaChart id = "areachart" color = "0 x 323232" height = "100" >
    < mx:series >
    < mx:AreaSeries yField = "Profit" / >
    < / mx:series >
    < / mx:AreaChart >
    < / mx:Panel >
    < mx:Panel >
    < mx:AreaChart id = "areachart1" color = "0 x 323232" height = "100" >
    < mx:series >
    < mx:AreaSeries yField = "Profit" / >
    < / mx:series >
    < / mx:AreaChart >
    < / mx:Panel >
    < / mx:Application >

    Hi SiHoop,

    You need to defenitely label it when you're assiging the data for the table itself.

    var array: Array = [{Profit: 2000}, {Profit: 2400}];

    That the above is equivalent to creating an object and pushing data to a table.

    You can use the above statement as... goes

    var array: Array = new Array();

    var obj:Object = new Object();

    obj. Profit = 2000;

    Array.push (obj);

    obj:object = new Object();

    obj. Profit = 2400;

    Array.push (obj);

    In fact {Profit: 2000} represnts an object... including the benefit's label (property of the object) to the value.

    var array: Array = [{Profit: 2000}, {Profit: 2400}]; is the easiest way to initialize the array. You need to label it until then only you can access it with the label.

    Thank you

    Jean Claude

  • Subset of an arrayCollection collection

    How to select a subset of a table

    Collection appears in a datagrid? For example, in the code below, how can I select only records where pop > 2000?

    <? XML version = "1.0"? >
    <!-dpcontrols\SimpleDP.mxml->
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "creationComplete ="creationCompleteHandler ()">
    < mx:Script >
    <! [CDATA]
    Import mx.collections.ArrayCollection;
    [Bindable] private var _populations:ArrayCollection;
    public function creationCompleteHandler (): void {}
    _populations = new ArrayCollection collection;
    _populations. AddItem ({country: "Canada," continent: "NA", pop: "50"});
    _populations. AddItem ({country: "Fri" continent: "HIS" pop: "1000"});
    _populations. AddItem ({country: "USA," continent: "NA", pop: "5000"});
    _populations. AddItem ({country: "The Brazil" continent: "HIS" pop: "4000"});
    }
    []] >
    < / mx:Script >
    < mx:DataGrid id = "datagrid" dataProvider = "{_populations}" width = "100%" height = "100%" / >

    < / mx:Application >

    Hello

    You use a filter function on your table collection, it's pretty simple, I have a basic example I to another poster a few weeks back

    http://flashhub.net/filter/ - source is included

    So your filter should look like this, you can hard-code the value, but it is always better to use variables so that any part of your program can change the filter conditions.

    private var minPopulation: int = 500;<=== global="">

                protected function arrColl_filterFunc(item:Object):Boolean
                {
                        if (item.pop > minPopulation)
                        {
                            return true
                        }
                        else
                            return false;
                }
    

Maybe you are looking for

  • Tecra M10 - noise emissions

    Hello I'm new to this forum and looking for solution for continuous sound from the laptop Tecra M10. I can't play all other sounds. She starts soon as startup the laptop, but can be cut after the start of the window. Not sure if this is hardware or s

  • Tecra M1: Question about 21003B wireless adapter

    I have a Tecra M1 with 21003B wireless adapter. Company connection to one of our Wi - Fi points poses no problem - stay connected is a science. All the 1-2 hours all Wi - Fi access points 'disappear' app to auto-detection. The only way to reconnect i

  • Satellite P - PXE - E61 media test failure

    Pxe message shows their power be a problem with the hard drive. I changed the drive but still receive the message. How in the bios? When I press F12 when I start the computer, it gives me the CDDVDW TS-L632H-(PM) Start menu LAN ENTER SETUP Pressing e

  • After Windows Recovery virus, all programs, folders, and documents are hidden

    Hey there. I think I just cleaned my old machine to windows XP from a virus apparently known as Windows Recovery using software Malwarebytes' Anti Malware. I have two questions:1. How can I be sure that I deleted everything about the virus?2. the vir

  • Internet Explorer Google Toolbar cannot be read.

    I have a similar problem, it happened after that Microsoft has made a fix to a problem of supposed compatibility between windows 7 and internet explore. I arranged for the fix after repeatedly, having received a message on this issue when I open the