Macromedia Datasets do. You'll either need to reload the data while feeding
"Ken Fine" <kenfine@u.washington.edu> wrote in message
news:cqtfsh$h3u$1@forums.macromedia.com...
> I've been banging my head on this one for hours, and am about to go crazy
> with it. Can someone point out what obvious thing I'm missing?
> Scenario: I'm creating an XML object, and using that XML object to
populate
> a DataSet, which in turn populates a Datagrid. Datagrid sorts properly,
> indicating it is hooked up OK. I'm trying to use the results of a
combobox
> to filter the dataset (and in turn, the grid). The datagrid won't filter,
> either using the variable that's returned from the combobox, or a
hardcoded
> value. I'm on MX2004
>
> My code is a little strange because I'm using the XFactor studio Xpath and
> XmlDataSet classes available at
http://www.xfactorstudio.com/Actionscript/,
> but it's pretty straightforward. Mucho thanks to anyone who can help with
> this. This is the only thing remaining to get my app into a usable state.
>
> First, my combobox code, which is sorta irrelevant given that my datagrid
> won't filter on a hardcoded value:
>
> listenerObject = new Object();
> listenerObject.change = function(eventObject){
> trace ("listener detects change!")
>
> //this grabs the value from the combobox
> var myDropDownChoice
> myDropDownChoice=(eventObject.target.getValue());
> trace (myDropDownChoice);
> setFilter(myDropDownChoice);
> }
> myDropDown.addEventListener("change", listenerObject)
>
>
> // Then I declare my xpath stuff so I can return XML:
>
> import com.xfactorstudio.xml.xpath.*;
> import com.xfactorstudio.xml.XmlDataSet;
> myXmlDataSet = new XmlDataSet();
>
> myDataGrid.dataProvider = myXmlDataSet.dataProvider;
> myXmlDataSet.URL = "images.xml";
> myXmlDataSet.addQuery("Caption","/images/pic/caption");
> myXmlDataSet.addQuery("Title","/images/pic/image");
> myXmlDataSet.addQuery("PublicationDate","/images/pic/pubdate");
> myXmlDataSet.addQuery("Category","/images/pic/category");
>
> // I try and fail to filter my DataSet:
>
> setFilter= new Object
> setFilter= function (request) {
> myXmlDataSet.filtered = false;
> trace ("setting filter")
> trace ("REQUEST" + (request));
> myXmlDataSet.filtered = true;
> myXmlDataSet.filterFunc = function(item:Object) {
> return(item.Category == ("fun"));
> trace ("filter is set");
> }
>
> // The machine returns a trace statement on all items except for the last:
> trace ("filter is set");
> // I haven't figured out what's the problem.
>
> }
>
> //Further down the page, I trigger the dataset:
>
> myXmlDataSet.trigger();
> stop();
>
>
> If anyone has any bright ideas on what's wrong, I'd really appreciate the
> help. Thanks.
>
> -KF
>
>