Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8620629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:37:34+00:00 2026-06-12T06:37:34+00:00

I have an array populated with input from an SQLite database. When I use

  • 0

I have an array populated with input from an SQLite database. When I use this array as the dataprovider for a s:list then it will display all the objects in the array that I specify.
I would like to access some of the objects in the array, and have been trying to use getItemAt(). At the moment I can return the first object in the array, but changing the index (to getItemAt(1) for example), it returns nothing.

Ultimately I am aiming to populate an FX:Model with data entered elsewhere in the application and inserted into the SQLite database. The model then acts as the dataprovider for a pie chart. I can pass the first entry of the database on to the model/pie chart, but can’t access others.

Some relevant sections of code are as follows. Trouble shooting tips would be appreciated.

[Bindable]
    private var GHGsource:ArrayCollection;

And then:

            GHGsource = new ArrayCollection();
        }
        for each ( var o:Object in event.data )
        {
            GHGsource.addItem(o);
        }
        FullList.dataProvider = GHGsource;
    }
}

Model setup:

<fx:Declarations>
    <fx:Model id="GHG" >
<data>
<row>
<input>Enteric methane</input>
<Value> {GHGsource.getItemAt(0).answer}  </Value>

List setup:

<s:List id="FullList">
  <s:itemRenderer>
    <fx:Component>
      <s:IconItemRenderer labelFunction="returnQuestion" messageFunction="returnAnswer">
        <fx:Script>
          <![CDATA[                             
            private function returnQuestion(item:Object):String
            {
                return "Question: " + item.question;
            }
            private function returnAnswer(item:Object):String
            {
                var response:String = "";
                if ( !item.answer || item.answer == "" )
                {
                    response = "(no response)";
                } else {
                    response = item.answer;
                }
                return response;
            }
          ]]>
        </fx:Script>
      </s:IconItemRenderer>
    </fx:Component>
  </s:itemRenderer>
</s:List>

This application is based on the database structures set out in Daniel Koestler’s survey ape application.

Perhaps an insight into how the s:List component accesses objects in an array will help here?

Additional detail:

Running in debug mode it seems as though that the objects are not binding correctly to the arraycollection.
warning: unable to bind to property ‘xxx’ on class ‘Object’ (class is not an IEventDispatcher)

I have tried to follow guides on the following links, but have not been sucessfull.
link1
link2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:37:35+00:00Added an answer on June 12, 2026 at 6:37 am

    Ok, got it.

       GHGsource = new ArrayCollection();
        }
        for each ( var o:Object in event.data )
        {
            GHGsource.addItem(o);
        }
        FullList.dataProvider = GHGsource;
     }
    }
    

    Becomes:

    [Bindable]
    private var passingArray:Array;
    

    And:

       GHGsource = new ArrayCollection();
       passingArray = new Array();
    
        }
        for each ( var o:Object in event.data )
        {
            GHGsource.addItem(o);
            passingArray[o] = new ObjectProxy(event.data[o]);
        }
        // not needed as the list is no longer needed - FullList.dataProvider = GHGsource;
    }
    }
    

    Then this works:

    <fx:Declarations>
    <fx:Model id="GHG" >
    <data>
    <row>
    <input>Enteric methane</input>
    <Value> {GHGsource.getItemAt(3).answer}  </Value>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this array list that is populated using a csv file. Once
i have a drop down list which is populated dynamically from database table i.e
I have an array that was populated by this script : var imgs =
I have a PHP file that serves up a JSON array populated from a
I have an associative array in awk that gets populated like this: chr_count[$3]++ When
I have an html select box that is populated by an array from the
i have this jquery code which poplautes a input selector, which should display like
I have my array populated like so: updateLabels: function () { var diagrams =
Hi guys i have an array that is populated with dates Array ( [0]
I have populated an array with a few html image tags that I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.