ObjectProxy to ArrayCollection

Hi to all.
I am Vladimir from Serbia.
I try to learn flex over the video tutorials and google. I am a new in flex and programing.
Have a problem, and I need yours help.
How to insert data from objectProxy to ArrayCollection.
Here is my mxml code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:views="views.*"
     creationComplete="initApp()" backgroundColor="#000000" >
     <mx:Style>
          .picturePanel, .thumb {
               border-style: solid;
               border-thickness:1px;
               background-color:#0F0F0F;
               border-color:#6F6F6F;
               corner-radius:10;
          .thumb {
               padding-bottom:10;
               padding-top:10;
          .buttons {
               fillColors:#0F0F0F, #6F6F6F;
               fill-alphas: 1, 8;
               color: #ffffff;
               textRollOverColor:#FFFFFF;
                  textSelectedColor:#FFFFFF;
     </mx:Style>
     <mx:Script>
          <![CDATA[
               import mx.controls.Alert;
               import mx.utils.ObjectProxy;
               import mx.rpc.events.ResultEvent;
               import volueObjects.photo;
               import mx.collections.ArrayCollection;
               import mx.utils.ArrayUtil;
               [Bindable]
               public var photoData:ArrayCollection = new ArrayCollection();
               [Bindable]
               private var photoRaw:ArrayCollection;
               // Result Handler - Fires when all data are coledted from xml
               private function photosInHandler(event:ResultEvent):void
                    // Inserting data in the photoRaw array collection
                    if (event.result.photos == null)
                         photoRaw = new ArrayCollection();
                    else if (event.result.photos.image is ArrayCollection)
                         photoRaw = event.result.photos.image;
                    else if (event.result.photos.image is ObjectProxy)
                         photoRaw = new ArrayCollection(ArrayUtil.toArray(event.result.photos.image));    
                    //Alert.show(photoRaw.length.toString());
                    // For loop
                    for ( var i:int=0; i<photoRaw.length; i++)
                         // Creating valueObject
                         var tempPhoto:photo = new photo();
                         //Creating object and inserting data from array collection
                         var photoFromArray:Object = photoRaw.getItemAt(i);
                         // Inserting data in  tempPhoto value object
                         tempPhoto.filename = photoFromArray.filename;
                         tempPhoto.photographer = photoFromArray.photographer;
                         tempPhoto.category = photoFromArray.category;
                         tempPhoto.desc = photoFromArray.desc;
                         //Adding data in photoData Array
                         photoData.addItem(tempPhoto);
               // starting Http Service. Send data
               private function initApp():void
                    photosIn.send();
          ]]>
     </mx:Script>
     <mx:HTTPService id="photosIn" method="get" showBusyCursor="true"
          url="selectData.php" result="photosInHandler(event)"  />
          <mx:LinkBar dataProvider="{Content}" fontSize="20" color="#FFFFFF" rollOverColor="#B5D2FA" x="350" y="10"/>
               <mx:ViewStack id="Content" resizeToContent="true" x="101" y="118">
                    <views:home id="home" label="Home"/>
                    <views:gallery id="gallery" label="Gallery" photoData="{photoData}" />
     </mx:ViewStack>
</mx:Application>
Here is php code:
<?php
echo "<?xml version=\"1.0\" \n?>";
$conn = mysql_connect("localhost", "root","");
if (!mysql_select_db("mygallerydb")) {
    echo "Unable to select mygallerydb: " . mysql_error();
    exit;
$sql = "SELECT * FROM photos";
$result = mysql_query($sql);
$filename = $_GET["filename"];
$photographer = $_GET["photographer"];
$category = $_GET["category"];
$desc = $_GET["desc"];
/* print out your own XML */
echo "<photos>\n";
while( $row = mysql_fetch_object( $result ) )
   echo "<image><filename>".$row->filename."</filename><photographer>".$row->photographer."</photographer>
                    <category>".$row->category."</category><desc>".$row->desc."</desc></image>";
echo "</photos>";
?>
I getting one row with values:
tempPhoto    volueObjects.photo (@19add2b1)   
    category    "".$row->category.""   
    desc    "".$row->desc.""   
    filename    "".$row->filename.""   
    photographer    "".$row->photographer.""  
Can someone help me?
thanks in advance

I found problem.
when i start the project i did not set application server type.
Thanks anyway.

Similar Messages

  • How to tell if ObjectProxy contains ArrayCollection or single object?

    When I get data back from a web service, the list contains an
    ArrayCollection. Within each ArrayCollection, the item may be
    either a single object, or an ArrayCollection of theser objects. It
    appears FLEX supplies what it thinks is the correct type of
    ObjectProxy object based on the number of children under the parent
    node.
    If the ObjectProxy refers to an ArrayCollection, I want to
    iterate over it, but if it refres to a single object, I want to
    pull off some of it's properties.
    How can I tell at run time if an ObjectProxy refers to an
    ArrayCollection, or a single object? Thanks very much in
    advance!

    Found an answer here:
    http://www.theruntime.com/blogs/be-sharp/archive/2008/02/26/web-services-and-arraycollecti ons-in-adobe-flex-2-how-to-successfully-read-any-number-of-xml-nodes.aspx
    which provides an answer if there are NO child nodes, if
    there is exactly one child node, or if there are multiple child
    nodes...

  • Converting Array Objects into ArrayCollections

    Hi,
    I am facing problem with converting Array Objects into ArrayCollections. How can i convert Array Objects into ArrayCollections. If any one knows how can we do that Pl reply.
    Thanks in advance to all
    Regards
    subbareddy.p

    Hi Bhasker,
    thanks for u r reply. Here i attached screen shot of my server "data.result".
    My proxy varaible contains
    My object varaible "obj" contains
    After parsing the result my arraycollection contains, (i mean after converting Object to Array to ArrayCollection) the below information. For information Pl find the attached arraycollection.png image. In the attached image my arraycollection name is "users".
    Here i pasted the code that i used  to convert  "ObjectProxy" to "ArrayCollection"
    var proxy:ObjectProxy = ObjectProxy(data.result);
                var obj:Object = proxy.object_proxy::object;
                var arrycoll:Array = ArrayUtil.toArray(obj); 
                model.users = new ArrayCollection(arrycoll);
    Regards
    sss

  • Arraycollections Problem

    Hi i'm having some problems with Arraycollections. here is what my intention is and what i'm doing
    What i want:  I want to send some information from the flex ui to a java class . and save this info in a data base.
    What i'm doing:
    I'm packing the info into a Arraycollection(it consists of an 2-D integer array and a String array).
    Sending  it to a java class using remote object. I'm using  flex.messaging.io.ArrayCollection package to use Arraycolelction to  recieve that data in java class
    Problem:  I want o extract the  integer array and String array from that ArrayCollection so that i can  use it to store them in DB.
    Am i doing anything wrong?? Is there any alternate way like storing the whole Arraycollection as it is in DB

    Hi Bhasker,
    thanks for u r reply. Here i attached screen shot of my server "data.result".
    My proxy varaible contains
    My object varaible "obj" contains
    After parsing the result my arraycollection contains, (i mean after converting Object to Array to ArrayCollection) the below information. For information Pl find the attached arraycollection.png image. In the attached image my arraycollection name is "users".
    Here i pasted the code that i used  to convert  "ObjectProxy" to "ArrayCollection"
    var proxy:ObjectProxy = ObjectProxy(data.result);
                var obj:Object = proxy.object_proxy::object;
                var arrycoll:Array = ArrayUtil.toArray(obj); 
                model.users = new ArrayCollection(arrycoll);
    Regards
    sss

  • Using predefined data objects classes.

    I am always trying to be a better, more efficient Flex developer and I was looking at a project by Christophe Coenraets where he created collaberative forms using Flex/BlazeDS. I saw in his application that he was using multidirectional binding to a Class Object for each form in the application. For example, this is the MortgageApplication.as
    package
        import mx.collections.ArrayCollection;
        [Bindable]
        public class MortgageApplication
            public var firstName:String;
            public var lastName:String;
            public var ssn:String;
            public var phone:String;
            public var mobilePhone:String;
            public var email:String;
            public var notify:Boolean;
            public var usCitizen:Boolean;
            public var address:String
            public var city:String
            public var state:String
            public var zip:String
            public var singleFamily:Boolean;
            public var salePrice:Number = 500000;
            public var downPayment:Number = 100000;
            public var closingDate:Date;
            public var jobList:ArrayCollection = new ArrayCollection();
    I have an application that I use multiple forms to input information into the database and then I use Objects (actually ObjectProxys) and ArrayCollections to store information to display. I use the Mate Framework and have manager classes that store predefined bindable variables (empty)  that are injected into the view as needed or requested. In the manager class I just create a new ObjectProxy (or ArrayCollection) and use the information passed in (an ArrayCollection from ColdFusion) and create/modify the ObjectProxy/ArrayCollection before having it injected.
    Is it better practice or more efficent to predefine object classes (such as above from the example) then just populate them in the manager class before the injection or just create an new blank Object or ArrayCollection on the fly. Is there any difference?
    Set up a seperate Class:
    package
        [Bindable]
        public class Person
            public var firstName:String;
            public var lastName:String;
            public var phone:String;
    and do this in the Manager:
    public function setPerson():void {
         var person = new Person();
         person.firstName = "Steve";
         person.lastName = "Smith";
         person.phone = "555.555.1212";
    OR just have this declaired in the Manager as
    [Bindable] public var person:ObjectProxy;
    public function setPerson():void {
         person = new ObjectProxy();
         person.firstName = "Steve";
         person.lastName = "Smith";
         person.phone = "555.555.1212";
    Thanks to anyone who wants to help me become a better developer!

    ObjectProxy access is significantly slower that data class access.  ObjectProxy will not tell you if you mistype the name of a property and you can spend hours trying to find some place were you typed ssm insead of ssn.

  • Error when reading data in to ArrayCollection using HTTPService

    Hi,
    I am trying to read data in to ArrayCollection using HTTPService result property:
    [Bindable] private var myData:ArrayCollection=new ArrayCollection();
       private function result_handler(e:ResultEvent):void
            myData = e.result.root.contact;
      <mx:HTTPService id="post_submit"
           url="test.php"
           method="POST"
           result="result_handler(event)"
           fault="fault_handler(event)">
           <mx:request xmlns="">
           </mx:request>
       </mx:HTTPService>
    I am getting the following error when there is no "contact" record in the xml root:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Also I am getting the following error when there is only ONE  "contact" record in the xml root:
    TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@280c9ca1 to mx.collections.ArrayCollection.
    And it works fine when there is two or more "contact" records in the xml root.
    Am I missing something?
    Thanks

    I am getting the following error when there is no "contact" record in the xml root:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
         You'll be getting this error because it's trying to access nodes that don't exist;
         there are no 'contact' records, thus when it tries to access node 'root.contact', it doesn't exist, hence it's receiving NULL when it's expecting      something
    Also I am getting the following error when there is only ONE  "contact" record in the xml root:TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@280c9ca1 to mx.collections.ArrayCollection.
    And it works fine when there is two or more "contact" records in the xml root.
    Am I missing something?
    Thanks
          When there is only 1 value, it'll be returned as an object (Arrays are used for multiple items). So it throws an error as it isn't expecting a single           object, it wants an Array.
         This is also why when it returns 2+ records, there is no error. Multiple results will be returned as an Array, what your flex app was expecting.
         My initial guess to solve the first problem would be similar to Greg's, although i'm guessing you'd want;
        if(e.result != null){
         instead of
         if(e.result.root.contact != null){
        as you'd initially want to check if anything was returned in the result, rather than checking to see if a certain node exists.
         If you attempt to see if a certain node isn't null, and the node doesn't exist, it'll probably throw another #1009
         For the #1034 error, you'll have to check to see how many results were returned, as Madhav has described for you.

  • Help with creating objects for ArrayCollection

    Hi all,
    I am trying to update an ArrayCollection with Objects created
    in ActionScript
    In the end the array collection will provide data to a chart
    I can add the objects to my arrayCollection and access the
    values of the properties via text field output but the data is not
    Bindable
    So my text field shows the values from my AC but my chart
    isn't getting the data

    AaffordableWeb:
    Wrapping the Object in an ObjectProxy seems to have worked in
    that the properties are bound but my Chart shows nothing.
    I have posted the code below (keep in mind its a work in
    progress)
    Any help would be appreciated.
    //////Code
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="handleResult(event);">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent;
    import mx.rpc.events.ResultEvent;
    import mx.utils.ObjectUtil;
    import mx.utils.ObjectProxy;
    //// set price change range for the four arrays
    [Bindable]
    public var nPchange:Array = new Array(-12, -11,
    -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0);
    [Bindable]
    public var pPchange:Array = new Array(12, 11,
    10,9,8,7,6,5,4,3,2,1,0);
    //// Set up temprary var
    [Bindable]
    public var tempval:*;
    [Bindable]
    public var tempval2:*;
    [Bindable]
    public var tempvaly:*;
    [Bindable]
    public var tempvalr:*;
    [Bindable]
    public var tempvalr2:*;
    [Bindable]
    public var tempvalry:*;
    [Bindable]
    public var ylovert:Array = new Array;
    [Bindable]
    public var rylovert:Array = new Array;
    [Bindable]
    public var ymin:*;
    [Bindable]
    public var testarray:Array;
    /// declare the lPrime ac
    // declare the rprime ac
    [Bindable]
    public var rPrime:ArrayCollection = new ArrayCollection();
    // declare rylover ac
    [Bindable]
    public var ryLover:ArrayCollection = new ArrayCollection();
    // declare ylover ac
    [Bindable]
    public var yLover:ArrayCollection = new ArrayCollection();
    /// declare default cMargin
    [Bindable]
    public var cMargin:* = 80;
    [Bindable]
    public var lPrime:ArrayCollection;
    public function handleResult(event:FlexEvent):void
    pedata();
    public function pedata():*{
    /// begin loop
    lPrime = new ArrayCollection();
    for(var n:int = 0; n < nPchange.length; n++){
    var value:* = nPchange[n];
    if(value == 0){value = .0001;}else{value = value;}
    tempval = -1 * value / (cMargin + value);
    tempval2 = (tempval / value);
    ylovert.push(tempval2);
    var o:Object = new Object;
    o.PriceChange= value;
    o.PriceElasticity= tempval2;
    lPrime.addItem(new ObjectProxy(o));
    } // end loop
    lprime.xField= "PriceChange";
    lprime.yField= "PriceElasticity";
    lprime.dataProvider = lPrime;
    ///last brkt
    ]]>
    </mx:Script>
    <mx:AreaChart id="myChart" showDataTips="true"
    mouseSensitivity="25" width="100%" >
    <mx:horizontalAxis>
    <mx:LinearAxis maximumLabelPrecision="1" title="Pricec2a"
    minimum="-12" maximum="12"/>
    </mx:horizontalAxis>
    <mx:verticalAxis>
    <mx:LinearAxis displayName="Price Elasticity to Break
    Even" minimum="-1.5" maximum="-1" />
    </mx:verticalAxis>
    <mx:series>
    <mx:AreaSeries id="lprime" form="curve" >
    <mx:areaFill>
    <mx:SolidColor color="red"/>
    </mx:areaFill></mx:AreaSeries>
    </mx:series>
    </mx:AreaChart>
    <mx:Text id="txt2"
    text="{lPrime.getItemAt(3).PriceElasticity}"/>
    </mx:Application>

  • Result type is mx.utils.ObjectProxy

    Hi,
    I am using a calling a Java RemoteObject to return results
    from a database and the result that is returned is of type
    mx.utils.ObjectProxy.
    Each ChildNode of this ObjectProxy is an ArrayCollection
    whose name I want to use to populate a combobox.
    How do I do this?
    I'm running Flex 2.0.1
    Please help,
    Thanks...

    Hi, I have the same problem.
    Trying to use solution from
    http://www.docsultant.com/site2/articles/flex_internals.html#objectproxy
    but without result.

  • Whats the difference between arrayCollection = null and arrayCollection.removeAll()?

    Whats the difference between arrayCollection = null and
    arrayCollection.removeAll()?

    In arrayCollection = null; statement you're setting this
    reference to null and potentially making it available for garbage
    collection. I say 'this reference' and potentially because, as you
    may know, there might be other references to this array collection
    object that won't be affected by this statement and hence it won't
    be GC'ed.
    arrayCollection.removeAll() says that I want to empty this
    array collection for all the reference that we pointing to it. That
    is, remove all the objects from the collection -- and of course
    make them 'potentially' available for the GC -- the size of the
    array collection would be reduced down to zero and all the
    references would be pointing to a valid but empty collection.
    Hope this helps.
    ATTA

  • Getting values from a datagrid to an ArrayCollection

    Hi, I have a drag and dropable datagrid. I fill it with rows of data from another datagrid. Finally, my application demands savings the data from the datagrid into an array collection along with the index of each row. How do i get values from a datagrid into an arrayCollection variable? Please help me..!

    Whatever is dropped into the DataGrid automatically goes into its dataProvider property, typically an ArrayCollection. Just access the data grid's dataProvider property to see the values.

  • Problem updating a SOAP Web Service with ArrayCollection

    Hello,
    I am having issues POST'ing an ArrayCollection to a C# Web
    Method. Here's how I have my application set up:
    I have a DataGrid in my application and set the dataProvider
    to be the result object of a Web Service operation. I set the
    DataGrid's editable property to "true" and would like to be able to
    edit the data and send off the DataGrid's dataProvider as the
    parameter for the Web Method. If I edit the first row of the
    DataGrid and trigger the operation, it gets saved just fine. If I
    try to edit any other row this way, it keeps sending the same
    packet (as verified by a packet sniffer) not allowing me to update
    any other row. It seems the Web Service is sending the first 255
    characters of the serialized ArrayCollection.
    My questions are: why is this happening?
    and
    How can I fix this?
    Here is the request of my Web Service operation:
    <mx:request xmlns="">
    <GlossaryTerms>
    {GlossaryArrayCollection}
    </GlossaryTerms>
    </mx:request>
    This is the definition of GlossaryArrayCollection:
    [Bindable]
    public var GlossaryArrayCollection:ArrayCollection = new
    ArrayCollection();
    Here is the SOAP packet that the C# Web Method is expecting:
    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="
    http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <GlossaryUpdate xmlns="">
    <GlossaryTerms>
    <Glossary cID="int" cDeleted="boolean" cTerm="string"
    cDefinition="string" cURL="string" cPublic="boolean"
    cRowVersion="string"/>
    <Glossary cID="int" cDeleted="boolean" cTerm="string"
    cDefinition="string" cURL="string" cPublic="boolean"
    cRowVersion="string" />
    </GlossaryTerms>
    </GlossaryUpdate>
    </soap12:Body>
    </soap12:Envelope>
    Thanks to anyone for their help.
    Brian Cary

    Where exactly you are seeing this error? possible for you share the screenshot?
    Execution failed: These policy alternatives can not be satisfied:
    {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SupportingTokens

  • How do you add multiple filters with checkboxes to an arrayCollection?

    hey guys... so i have three checkboxes and when i click one of them i need to filter out my array collection according to which ones are clicked
    I have the filter function working partially, but when i select multiple checkboxes i dont see anything in the arraycollection.
    the code i have is
    <s:VGroup x="-100" y="400">
         <mx:HRule />
         <s:CheckBox label="Approved Stories" color="#333333" selected="@{_approved}" change="filterChanged()" />
         <s:CheckBox label="Rejected Stories" color="#0184C7" selected="@{_rejected}" change="filterChanged()" />
         <s:CheckBox label="Pending Stories" color="#50C8E8" selected="@{_pending}" change="filterChanged()" />
    </s:VGroup>
    <s:DataGroup width="100%" height="100%" clipAndEnableScrolling="true" dataProvider="{filteredStoryDataArr}" click="itemClicked();">
    </s:DataGroup>
    private function returnesAllStories(event:ResultEvent):void{
         for each(var item:Object in event.result){
              storyDataArr.addItem(item);
         filteredStoryDataArr = new ArrayCollection(storyDataArr.source);
         filteredStoryDataArr.filterFunction = storyFilter;
    public function storyFilter(item:Object):Boolean
         return    (!_approved || ((item.ApprovedBy > 0) && (item.DateApproved != ""))) &&
                (!_pending || ((item.ApprovedBy == -1) && (item.DateApproved == ""))) &&
                (!_rejected || ((item.ApprovedBy == 0) || (isNaN(item.ApprovedBy))));
    public function filterChanged():void{
         filteredStoryDataArr.refresh();
    right now if i click approved i see all the approved stories, or if i check pending, i see all the pending stories.... but if i check pending and rejected, i dont see anythign in the list... any ideas how to fix that???

    there is no built-in way to do this. the only way i know is by using Mail Scripts
    http://homepage.mac.com/aamann/Mail_Scripts.html
    it has a script "Add addresses" that does just what you want.

  • How do you add multiple filters to an arrayCollection?

    hey guys... so i have three checkboxes and when i click one of them i need to filter out my array collection according to which ones are clicked
    I have the filter function working partially, but when i select multiple checkboxes i dont see anything in the arraycollection.
    the code i have is
    <s:VGroup x="-100" y="400">
         <mx:HRule />
         <s:CheckBox label="Approved Stories" color="#333333" selected="@{_approved}" change="filterChanged()" />
         <s:CheckBox label="Rejected Stories" color="#0184C7" selected="@{_rejected}" change="filterChanged()" />
         <s:CheckBox label="Pending Stories" color="#50C8E8" selected="@{_pending}" change="filterChanged()" />
    </s:VGroup>
    <s:DataGroup width="100%" height="100%" clipAndEnableScrolling="true" dataProvider="{filteredStoryDataArr}" click="itemClicked();">
    </s:DataGroup>
    private function returnesAllStories(event:ResultEvent):void{
         for each(var item:Object in event.result){
              storyDataArr.addItem(item);
         filteredStoryDataArr = new ArrayCollection(storyDataArr.source);
         filteredStoryDataArr.filterFunction = storyFilter;
    public function storyFilter(item:Object):Boolean
         return    (!_approved || ((item.ApprovedBy > 0) && (item.DateApproved != ""))) &&
                (!_pending || ((item.ApprovedBy == -1) && (item.DateApproved == ""))) &&
                (!_rejected || ((item.ApprovedBy == 0) || (isNaN(item.ApprovedBy))));
    public function filterChanged():void{
         filteredStoryDataArr.refresh();
    right now if i click approved i see all the approved stories, or if i check pending, i see all the pending stories.... but if i check pending and rejected, i dont see anythign in the list... any ideas how to fix that???

    Jer&Renee,
    welcome to Apple Discussions.
    It depends where you want them in your presentation.
    Open the Media inspector and choose a playlist. In the list of entries, mark those you want to add to Keynote (use command-click to mark multiple titles not in one block).
    Then drag the marked titles either on a slide or on the small Audio field (looks like a frame) in Document inspector. When you then hover the cursor at the Audio "frame", you'll see the quick info "Multiple Files". You cannot change the order or remove one of the files, but only all of them.

  • How can we enter the data dynamically from datagrid to an arraycollection?

    Hi All
                        How can we make datagrid fields editable when it is in empty position i mean the datagrid doesn't have any data to display.. and it must accept the data and update the arraycollection dynamically..
                 Now in my Application the datagrid is empty and it is not accepting any values and it still remain ideal..  i am unable to edit the datagrid fields in the datagrid .....
      Please some one tell me how can i achieve this...

    Here is a very basic example.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete()">
    <mx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       [Bindable] private var _dataProvider:ArrayCollection;
       private function onCreationComplete():void {
        _dataProvider = new ArrayCollection();
        for(var i:int = 1; i <= 100; ++i)
         _dataProvider.addItem({ROW:i,A:"",B:"",C:"",D:"",E:"",F:"",G:"",H:"",I:"",J:"",K:"",L:"", M:"",N:"",O:"",P:""});
      ]]>
    </mx:Script>
    <mx:Panel title="Editable DataGrid Example" height="472" width="584" horizontalCenter="0" verticalCenter="0">
      <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{_dataProvider}" editable="true" horizontalScrollPolicy="on" sortableColumns="false" draggableColumns="false">
       <mx:columns>
        <mx:DataGridColumn dataField="ROW" headerText="" width="30" sortable="false" draggable="false" editable="false" paddingLeft="0" paddingRight="0" textAlign="right"/>
        <mx:DataGridColumn dataField="A" headerText="A" width="100"/>
        <mx:DataGridColumn dataField="B" headerText="B" width="100"/>
        <mx:DataGridColumn dataField="C" headerText="C" width="100"/>
        <mx:DataGridColumn dataField="D" headerText="D" width="100"/>
        <mx:DataGridColumn dataField="E" headerText="E" width="100"/>
        <mx:DataGridColumn dataField="F" headerText="F" width="100"/>
        <mx:DataGridColumn dataField="G" headerText="G" width="100"/>
        <mx:DataGridColumn dataField="H" headerText="H" width="100"/>
        <mx:DataGridColumn dataField="I" headerText="I" width="100"/>
        <mx:DataGridColumn dataField="J" headerText="J" width="100"/>
        <mx:DataGridColumn dataField="K" headerText="K" width="100"/>
        <mx:DataGridColumn dataField="L" headerText="L" width="100"/>
        <mx:DataGridColumn dataField="M" headerText="M" width="100"/>
        <mx:DataGridColumn dataField="N" headerText="N" width="100"/>
        <mx:DataGridColumn dataField="O" headerText="O" width="100"/>
        <mx:DataGridColumn dataField="P" headerText="P" width="100"/>
       </mx:columns>
      </mx:DataGrid>
    </mx:Panel>
    </mx:Application>
    Hope this helps

  • How can i convert a arraycollection to an XmlList to put as a dataprovider for ADG

    I have a arraycollection which i'm getting from backend.I need to convert it into XMLList with nodes, because i have to show the data like branches in ADG.
    now I'm using  grouping but getting lot of sorting issues. so i want to convert it into XmlList to show the data as it is.
    is there any way to handle this issue??
    Sample example can be appreciated.

    Hello,
    I am looking for some further information about this.
    I have an array collection of about 8 fields worth wide and say 200 rows deep and is dynamic.
    I need to take this cf query result and populate a tree control with the data.
    As I understand the above post, it will loop over only the first column in the query result set.
    How can I go about creating the children or level 2, level 3 etc
    Data structure would be something like this:
    caldate, Division, Batalion, Shift, Station, actCat, actionbyname, asstocode,
    The first is a datetime, while all others are char.
    Grouping should occur left to right in this order.
    Thanks
    Jim

Maybe you are looking for

  • Problem with HTML in a read only textarea item

    I'm working on a messaging system for our site. For the body of the message, we use a standard textarea item. However, if we come to the messaging page from a certain page in our system, then we pre-load the textarea item, and make it read only. The

  • External Monitor screen flicker fixed

    I had a problem with my 3rd party external mornitor that kept flickering. It happened all of a sudden and was a constant flicker that was really annoying. Anyways, I discovered that when the mini-dvi connector is near my speakers(which are unshielded

  • CS5-will it run on Celeron D

    Hi everyone, I currently have  Windows XP SP3, Intel Celeron D - 3.06 ghz, 1.5 gig ram, 46 gig hard disk space remaining, Nvidia Geoforce 6200 graphics card. I can get a good deal on CS5 for under $300. Will CS5 run on this system? I plan on getting

  • Clean install - can I save my old internet settings for wireless router

    I am upgrading to Leopard with a clean install. My only concern is that my sister got my computer hooked up to our wireless router ages ago and I'm afriad I won't be able to get back on wireless afterwards. Is there a way to backup this information,

  • Clearing out old software

    I am trying to clear out all remnants of old software, before upgrading to Snow Leopard. (I don't want to do a clean install, just put everything in order before doing a normal one.) For example, I discovered that my trial of Retrospect 8 had left th