0

Here, I wanna display multiple items in list fetched from sqlite database:

On-button click I call list function:

protected function showrecord_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                fetchfalseanswerquestion();             
            }

Function to fetch data from sqlite database:

protected function fetchfalseanswerquestion():void
            {
                sqlConnection = new SQLConnection();
                sqlConnection.open(File.applicationStorageDirectory.resolvePath("SchoolSeries.db"));
                var stmt:SQLStatement = new SQLStatement();
                stmt.sqlConnection = sqlConnection;
                stmt.text = "select * from Schoolseries_Exam_Mode_User_Answers where Result = 'False'";
                stmt.execute();
                var result11:SQLResult = stmt.getResult();
                DataModel.getInstance().connection = sqlConnection;
                                    listquestion.visible = true;
                listquestion.dataProvider = new ArrayCollection(result11.data[0].data);
            }

Here, are my button control and list control:

<s:Button id="showrecord" click="showrecord_clickHandler(event)">

</s:Button>

<s:List id="listquestion" visible="false" height="300" width="300" labelField="Fk_Question_Description">



</s:List>

But, when I run this I don't t get errors but no content has been displayed.

Any help/suggestion in code are welcome.

Naveed Mansuri
  • 439
  • 1
  • 5
  • 13
  • 1
    sounds like your ArrayCollection is empty. are you sure your SQL returns any results? –  Aug 02 '13 at 16:00
  • 1
    After verifying that the ArrayCollection is not empty, you should confirm that each row in the data returned from SQLite has a field with the name "Fk_Question_Description". Completely unrelated: you might want to consider using `sqlConnection.openAsync()` to perform all your database operations asynchronously, so your UI doesn't lock up while performing queries. – Sunil D. Aug 02 '13 at 16:15

0 Answers0