FORUMS: list search recent posts

Searching DataSet and displaying results

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Searching DataSet and displaying results
on Sep 13, 2007 at 8:08:39 pm

I'm trying to create an application that searches the data contained in a dataset and displays matches in a listbox.

My data is contained in an XML file. Each item contains a name attribute and category attribute (plus others, but those two need to be searchable). An XML connector imports the data and passes it to a DataSet, which then populates a listbox with the name of each item. All of this works.

My two search options are a ComboBox that shows a list of categories, and a text field where users can type their search. I've tried using dataSet.find() to search these boxes, but I'm missing some part of the equation somewhere. This is the code I've been playing with for the search box (in it's current version, I've gone through several):


searchBtn.onRelease = function() {
dataSet.addSort(name, name, DataSetIterator.CaseInsensitive);

The trace is in there to see if it would return a value, showing me that there is actually still data in the DataSet. Right now it's returning undefined.

I've looked through the docs and tried the code they have in the DataSet.find() help file, but nothing seems to be working and I can't find anything online.

Return to posts index

Sher Ali
Re: Searching DataSet and displaying results
on Sep 13, 2007 at 9:51:39 pm

You get undefined because DataSet has no selectedItem property.

But it has a currentItem property, try this:

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved