Based on XML dataprovider of the Combobox / Dropdownlist (spark)

Hey guys,.

I'm struggling a bit with a problem...

I have a XML file which I use as a dataprovider for a combobox / dropdownlist. If I do that just in Flex with MXML (with a HTTP Service call and using its last result) it works well. However, I need to replace this XML file dynamically.

But if I give one a section of an XML file dynamically loaded (loading is successful (for example xmlFile.Sensors) as dataprovider, I get this message:)

Type coercion failed: cannot convert XMLList@18d8b629 to mx.collections.IList.

Well, I came to that:

collection: var = new XMLListCollection XMLListCollection();
for each (var t:XML in sensorXml.Sensors)
{
collection.addItem (t);
}

.. .and by using the collection as a dataprovider. But seems a bit unnecessary... isn't there to fill the dropdownlist control with its content faster / more direct? As for example dataGrid offers you to use XML files directly as dataproviders...

Hello

What follows is a basic application that dynamically load your xml result in your dataprovider comboboxes.

It may be useful

David.

http://ns.Adobe.com/MXML/2009.

xmlns:s = "library://ns.adobe.com/flex/spark".

xmlns:MX = "library://ns.adobe.com/flex/halo" minWidth = "955" "600" creationComplete = minHeight = "app_creationCompleteHandler (event)" ">"

Import mx.events.FlexEvent;

Import mx.rpc.events.FaultEvent;

Import mx.rpc.events.ResultEvent;

protected function myXML_resultHandler(event:ResultEvent):void

{

xmlMainMenu.source = event.result.children ();

}

protected function myXML_faultHandler(event:FaultEvent):void

{

Alert.Show ("could not sorry loading XML", "Error");

}

protected function app_creationCompleteHandler(event:FlexEvent):void

{

myXML.send ();

}

]]>

"result =" myXML_resultHandler (Event) "fault =" myXML_faultHandler (event) "/ >

======

the xml code

======

Tags: Flex

Similar Questions

  • Remote XML Dataprovider for the tree control

    Try to create a class of the tree instead of load application XML node list, to try to read from an external file called "nodes.xml". I tried to edit code snippets I've found from various sources and it's current iteration, I'm sure. Please advise on how to solve this problem!

    Note: In the XML itself I tried with and without the tags < mx:XMLList > wrapping, doesn't seem to work. Here is a link to a live demo: http://81.100.103.105/flex_dev/treeExample.html


    Thank you very much

    Alex, I was able to do the job of cleaning the XML file a little. Remove the XMLList and the? lines of xml, it looks like this:




















    FWIW, if the XML is static (that is to say, won't come running), then you can consider using the tag mx: Model. It has fewer resources than the URLLoader and it cooked the XML code in the SWF at compile time.

    HTH,
    Matt Horn
    Flex docs

  • XML to the combobox problem

    I am fill combobox from xml file, right

    My case: I'm reading the xml file that look like this

    < Download >
    < pallets >
    < pal30 name = "First map" >
    map1.XML < color > < / color >
    < / pal30 >
    < pal20 name = 'Second map' >
    map2.XML < color > < / color >
    < / pal20 >
    < / pallets >
    < / upload >

    by
    < mx:XML format = "e4x" id = "mapp" source="Database/Map.xml"/ >
    < mx:ComboBox = "263" x = "10" width = "194".
    ID = "myCb" enabled = "true".
    dataProvider = "{mapp.". Upload.palettes.*.@name} ">"
    < / mx:ComboBox >

    So, what I try to do is when I click on "Foreground" my ComboBox, I want to have 'map1.xml' 'printed' in a mx:Text control

    I can get the attribute name in the box by < mx:Text text = "{myCb.selectedItem}" / > that might be in this case 'Foreground' and I want to have 'map1.xml' when I click on 'First map' in the combobox.

    Do I have to create a kind of out of my xml file where values are tied together as
    {name: 'Foreground', file:"map1.xml'}



    The problem is that your nodes are not always named. If you had and then you could set the dataProvider = "{mapp.pal}" and labelField="@name" then the selectedItem.colors would be what you want. "

    When you used the expression you have created an array of values name only - there is no context longer. Try this instead:

    In a Script block:

    private void paletteName (point: Object): String
    {
    .@name XML (element) return;
    }

    private function test (event: Event): void
    {
    output. Text = XML (event.target.selectedItem). * Colors;
    }

    Now the selectedItem will be the XML for a node pal so XML (selectedItem). * Colors will be map1.xml or map2.xml.

  • My ComboBox does not work if I hardcode the dataProvider, not if the dataProvider of the remote object

    I have a ComboBox where the user can select a category of products to display. The ComboBox control is sitting on a custom component and the ArrayCollection collection that fills created in the same element that displays the list.

    I have two versions of the element containing the ComboBox control.

    Version 1:

    / / Create new variable as ArrayCollection collection tuped

            [Bindable]

    private var categoryList:ArrayCollection;

    / / initData method called on creationComplete

    private function initData():void{ }

    / / set values in the ArrayCollection collection

    categoryList = new ArrayCollection([ )

                "All Categories"

                      , "Appetizers"

                , "Butchery"

                , 'Candy & chocolate'

                , "Desserts"

                , 'Fruit & jam'

                , 'Gifts'

                , 'Grill & barbecue'

                , 'Honey and syrup'

                , 'Kitchen accessories'

                , "Little daviet Childrens Fun Food"

                , 'Denounced & other oils'

                , 'Oives & olive products'

                , « Pasta »

                , "Paste & fish"

                , 'Rice and cereal'

                , 'Sauces'

                , "Seasonings and Condiments"

                , 'Spreads'

                , "Truffles and mushrooms"

                , 'Vegetables'

                , 'Vinegar'

                ]);

    / / make this collection the data provider for catCombo

    catCombo.dataProvider = categoryList.

            }

    Version 2 (the result of a call to a ColdFusion cfc):

    / / Create new variable as ArrayCollection collection tuped

            [Bindable]

    private var categoryList:ArrayCollection;

    private function categoryListHandler(event:ResultEvent):void{ }

    categoryList = event.result as ArrayCollection; collection

    var catObj:Object = new Object();

    catObj.merchantCategory = 'all categories'

    categoryList.addItemAt (catObj, 0);

    catCombo.dataProvider = categoryList.

            }

    Everything else is identical in both versions of the custom component. The ComboBox is created like this:

    " < mx:ComboBox id ="catCombo"rowCount ="16"" "

          styleName = " " glass "

    Exchange = "dispatchFilter (); »

    " labelField ="merchantCategory"" "

          / >

    In both cases, catCombo is filled correctly. But...

    In version 1, when I select a different category, everything works as expected.

    In version 2, when I change the category, said filter "0 selected items" and nothing appears, even if I go back to "all categories". It's as if the filter sees nothing once there is a change in the selection of catCombo.

    Of course, I would prefer Version 2 because the catalog - and its categories - change in the month.

    So gurus, I would really like to start the new year with Version 2 of work, any ideas would be great appreciated. Everyone in the mood?

    Happy new year

    Carlos

    This code populates the combo very well box.

    I do not use a VO, or CFusion if... the thing with VO, I think it is we can do a selectedItem live on it because it is as [object], [object] you need actually to extrapolate this information or make it. toString();

    You have drawn to see what is selected when you select an item in the drop-down list? is this [object], [object]...

    I guess the cheapo to do would be to only capture the drop-down list box in a variable.

    So have the right filter for the variable that will be given, rather than the filter directly from the drop-down list box?

    It is quite difficult to the bug with all the code enough before you, but when you are only provided only a snippet of the code it makes it even harder.

  • Tracing a clips on the stage, based on XML

    Hi all
    I'm having a problem drawing a clip with AS2 on the stage based on XML. I think her looping thought the XML, but for some reason any its not draw all the clips on the timeline...

    So what I'm trying to do, is to trace a clip online based on its < note_position > and < note_height >, which he does very well. But its not trace all nodes < note >... trace 2 clips of < comment > < line tNom = "Name 1" color = "0 x 336633" > then it trace clips < note > 1 < line tNom = "Name 2" color = "0 x 333366" > then he traces 2 clips of < comment > < line tNom = "Name 3" color = '0 x 663366' >

    what he must do, is to trace all the clips of < comment > < line tNom = "Name 1" color = "0 x 336633" > then draw all the clips of < comment > < line tNom = "Name 2" color = "0 x 333366" > and last but not least draw all clips from < comment > < line tNom = "Name 3" color = '0 x 663366' >...

    So all in all it does is plotted 5 < note > clips in total instead of the 10 < note > clips must be traced on the stage...

    OK well I think I'm going to loos, my mind... Is more, I think that it is thought looping the XML that is the problem. I think that its so be it I enclose the clip of the plot or something I don't see thought the fog...

    Any ideas? Ive been battaling this for two days and I am at a total loss... so any help would be greatly apprecated.

    I thank in advance
    Scott: eek:

    OK, I got this work here is my fix...

    function attachXMLNodes () {}
    Attach the clip and insert my data
    var newPlot = attachMovie ("plot", "plot" + h + "" + i, this.getNextHighestDepth ());
    duplicateMovieClip ("plot", "plot" + i, depth);
    Assign the values...
    This ["conspiracy" + h + "" + i].entry_clip.entry_date = "" + entry_date + ""; "
    Finally, set the position
    This ['plot' + h + ' ' + i] ._y = 685;
    This ['plot' + h + ' ' + i] ._x = number (entry_pos).

    }

  • Text of the ComboBox displays do not at all.

    In Flash Builder 4, create a new project using the Flex SDK 4.1, and then set the project properties for the compiler to "Use of Flex 3 compatibility mode" is checked. Run the application and the first item in the drop-down list displays by default, but if you click on the ComboBox control to the menu dropdown opens, you can't see the items.

    Change the style color ComboBox and changing the itemRenderer do not fix the issue.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:ComboBox>
        <mx:dataProvider>
          <mx:String>one</mx:String>
          <mx:String>two</mx:String>
          <mx:String>three</mx:String>
        </mx:dataProvider>
      </mx:ComboBox>
    </mx:Application>
    
    
    


    ComboBox.png

    BTW, that should have been "ltr", not "rtl".

  • Store XML in the schema issue generated tables and XML Validation against the schema.

    Hello friends,

    I am facing a problem where to store xml in a saved schema generated from tables.

    It's my diagram

    --

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < xs: schema xmlns:ds = ' http://www.w3.org/2000/09/xmldsig# "" xmlns: XS = " " http://www.w3.org/2001/XMLSchema "xmlns =" " http://www.ABC.inf.in/test "targetNamespace =" " http://www.abc.inf.in/test" elementFormDefault = "qualified" attributeFormDefault = "unqualified" > "

    < xs: include schemaLocation = "abc.xsd" / >

    < xs: element name = "project" type = 'student' >

    < xs: annotation >

    < Intention > it is a Documentation < / intention >

    < / xs: annotation >

    < / xs: element >

    < / xs: Schema >

    -This is my xml document

    "< project versão ="2.00"xmlns ="http://www.abc.inf.in/test">."

    "< test xmlns ="http://www.abc.inf.in/test">."

    " < intest version ="2.00"Id ="testabc"xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "  >

    < ide >

    < cUF > 35 < / cUF >

    < cNF > 59386422 < / cNF >

    < natOp > This is post < / natOp >

    < indPag > 1 < / indPag >

    < mod > 55 < / mod >

    < set > 1 < / series >

    < / ide >...

    .....................

    Giving not complete because it is too long.

    1. I registered successfully of the schemas in the database

    2. then I generate the saved schema table

    2. in my java code I have validated the document XML schema compared and it's valid successfully.

    3 but when I recorded this XML file in the generated table there me gives error

    As:

    INSERT INTO XMLTABLE

    VALUES

    (XMLTYPE (bfilename('MYDIR','testabc.xml'), NLS_CHARSET_ID ('AL32UTF8')))

    Error report:

    SQL error: ORA-31061: error XDB: XML error event

    ORA-19202: an error has occurred in the processing of XML

    LSX-00333: literal '94032000' is not valid with regard to the model

    And I have to store this xml in tables of this so what I have to do?

    Thanks for your reply odie_63.

    I got this my solution for the error. My XML document is not well structured based on my registered XML schema.

    Average in My XML Document is an invalid value and which do not match my schema model so it gives this error

    SQL error: ORA-31061: error XDB: XML error event

    ORA-19202: an error has occurred in the processing of XML

    LSX-00333: literal '94032000' is not valid with regard to the model

    For the Solution, we have two ways

    1. I changed this literal value "94032000" in my xml file, then save it.

    2.

    -To delete this schema can

    -We need to change the schema for the particular element model

    like: -.

    -then to store xml in the database, it works...

    Thank you.

  • Approach to analyze the large number of XML files in the relational table.

    We are studying the possibility of XML DB to treat a large number of files from same day.
    The goal is to parse the XML file and store it in several relational tables. Once in the relational table don't care us about the XML file.
    The file cannot be stored on the file server and must be stored in a table before analysing because of security concerns. A third-party system will send the file and it will store in the XML database.
    The file size can be between 1 MB to 50MB and high performance is very that much is expected of other wise men, that the solution will be discarded.
    Although we have no of XSD, the XML file is well structured. We are 11g Release 2.

    Based on the reading, that's what my approach.
    1. CREATE THE DONNEES_XML TABLE
    (xml_col XMLTYPE)
    XMLTYPE xml_col STORE AS BINARY XML NAVIGATION;

    2. third will store the data in the donnees_xml table.
    3. create XMLINDEX on the unique XML element
    4 create XMLTYPE views
    CREATE OR REPLACE FORCE VIEW (V_XML_DATA)
    SType,
    Mtype,
    MNAME,
    ROT
    )
    AS
    SELECT x."Stype"
    x."Mtype."
    x."Mname"
    x."ROT".
    OF data_table t,.
    XMLTABLE)
    ' / SectionMain'
    PASSAGE t.data
    COLUMNS Stype VARCHAR2 (30) PATH "Stype"
    Mtype VARCHAR2 (3) path "Mtype."
    MNAME VARCHAR2 (30) PATH "MNAME"
    ROT VARCHAR2 (30) PATH "OID") x;

    5. loading mass analysis of data in the staging table based on the column in the index.

    Please comment on the process that precedes any suggestions that can improve the performance.

    Thank you
    AnuragT

    PASSAGE t.xml_col<--WHAT will="" passing="" here="" since="" no="">

    If you are using an XMLType Table, instead of an XMLType column reference, you are referring to the contents of XMLType while using the NICKNAME "OBJECT_VALUE" column

    If--> t.object_value

  • Display of text of the Combobox to type?

    Hello

    I do a stand-alone text field displaying the full word as long as the user types, but the word must make choices in a ComboBox.

    So, as they type 'a', if the first choice in the drop-down list is "Apple", apple appears in the text box. They type "aw", then, if "in the loop" is the first ' aw' displayed in the combobox Word, aware etc.»

    I'm about 1/3 is coding path through it, and thought I would ask here is a standard way to do this?

    for simplicity, I use the channels, if you have a Combo´Box with a DataProvider simply use instead

    var channels: Array = ["america", "australia", "alligator", "anchorman"];

    Strings.sort ();

    tf.addEventListener (Event.CHANGE, autocomplete);

    function autocomplete(e:Event):void

    {

    var entry: Array = e.target.text.split("");

    for (var i: uint = 0; i

    {

    for (var j: uint = 0; j

    {

    for (var k: uint = 0; k

    {

    var arrstrings:Array = strings [j].split("");

    If (input [i] == arrstrings [k])

    {

    e.Target.Text = strings [j];

    e.target.setSelection(0,e.target.text.length);

    return;

    }

    on the other

    {

    e.Target.Text = "NO MATCH FOUND";

    e.target.setSelection(0,e.target.text.length);

    }

    }

    }

    }

    }

  • How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox

    How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox?

    A sample of XML is like this:

    <>planter

    < Lauvtre >

    < Botanisk_navn > Acer campestre < / Botanisk_navn >

    < Norsk_navn > Naverlonn < / Norsk_navn >

    Gronn < Farge > < / fan >

    H4 < Herdighet > < / Herdighet >

    < Hoyde > 10-15 m < / Hoyde >

    < / Lauvtre >

    I have a combobox where it shows the botanical name and the Norwegian name. But the rest of the info in movieclips seem separate.

    Someone has an idea how to do this? Can I use the trace function maybe? Here is my AS3 code so far:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void

    {

    your. Text = list.selectedItem.data;

    TB. Text = list.selectedItem.label;

    }

    var xml;

    function onLoaded(e:Event):void

    {

    XML = new XML (e.target.data);

    var it: XMLList = xml. Planter.Lauvtre;

    for (var i: uint = 0; i < il.length (); i ++)

    {

    list.addItem ({data: it.}) Farge.Text ([i]) + "\n"+ it.» Herdighet.Text ([i]) + "\n" + it. Hoyde.text ([i]),

    label: it. Botanisk_navn. Text() [i] + "\n"+ it.» Norsk_navn. Text() [i]});

    }

    }

    Loader.Load (new URLRequest ("lauvtre.xml"));

    Thank you!

    Rheus.

    I don't know what you're trying to do.  but, if you want to fill one combobox with the botanical names and when one is chosen, the other use of logins:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void {}

    var selectedObj:Object = a [list.selectedIndex]

    trace (selectedObj ['fan'], selectedObj ['Botanisk'], etc);

    }

    var xml;

    var a: Array = [];

    function onLoaded(e:Event):void {}

    XML = new XML (e.target.data);

    var it: XMLList = xml. Lauvtre;

    for (var i: uint = 0; i

    list.addItem({label:il[i].child('Botanisk_navn').toString()});)

    a [i] = {'Fan': it [i].child('Farge').toString (), 'Herdighet': it [i].child('Herdighet').toString (), "Hoyde": he [i].child('Hoyde').toString (), 'Botanisk':il[i].child('Botanisk_navn').toString(),'Norsk_navn':il[i].child('Norsk_navn').toString()};}

    }

    }

    Loader.Load (new URLRequest ("test.xml"));

  • Dynamic dataProvider in Datagrid combobox.

    Hello

    I'm using Flex 3. I have a DataGrid with the first two lines, with an element converters like ComboBoxes. I want to set up is that, according to my selected in the combobox of first, second respective combobox must get a dataprovider of my choice.

    For example

    If I select the 1 combobox as the India, then the adjacent combobox should have cities in India.

    If I select the 1 combobox as the France, the adjacent combobox should have cities in France.

    I don't have the values in local variables. Values should be captured during execution, because the list of countries (in the first combobox) is very comprehensive in order to fetch the list of all the cities for all countries wouldn't be fair. So for each selection of country, I have to call an http service to retrieve the list of corresponding cities.

    My question is how can I dynamically give cities such as dataprovider to each of the combo boxes to each line.

    Hope that my description is quite understandable.

    Thank you

    SID.

    Hello

    You can check the code below. If this is what you need.


    http://www.Adobe.com/2006/mxml '.
    Layout = "vertical".
    creationComplete = "application1_initializeHandler (event)" > "
        
             Import mx.collections.ArrayCollection;
    Import mx.events.FlexEvent;
               
               
    Sets your collections
    [Bindable]
    public var countriesData:ArrayCollection = new collection ArrayCollection ([{label: "India"}, {label: 'Brazil'}]);
    [Bindable]
    public var citiesData:ArrayCollection;
    [Bindable]
    public var collection: collection ArrayCollection = new ArrayCollection();

    protected function application1_initializeHandler(event:FlexEvent):void
    {
    dataGrid.addEventListener ("countryChanged", country_changed_handler);
                    
    collection.addItem({cityData:citiesData});)
    }

    Override this method the remote calls.
    In the resultEvent, you will modify the citiesData collection.
    protected function country_changed_handler(event:DataEvent):void
    {
    If (event.data is "India")
    {
    dataGrid.selectedItem.cityData = new collection ArrayCollection ([{label: "Bombay"}, {label: "Delhi"}]);
    }
    on the other
    {
    dataGrid.selectedItem.cityData = new collection ArrayCollection ([{label: "São Paulo"}, {label: "Rio de Janeiro'"}]);
    }
    dataGrid.invalidateList ();
    }
               
    public void addRow(event:MouseEvent):void {}
    collection.addItem (new Object());
    collection.addItem({cityData:citiesData});)
    }
    public void dropRow(event:MouseEvent):void {}
                   
    }
    ]]>
        


    dataProvider = "{collection}" >
            
                
                    
                        
                            
    labelField = "label".

    change = "combobox1_changeHandler (Event)" "
    selectedIndex = "-1" >
                                
                                     Import mx.collections.ArrayCollection;
    Import mx.events.ListEvent;

    protected function combobox1_changeHandler(event:ListEvent):void
    {
    dispatchEvent (new DataEvent ("countryChanged", true, true, this.selectedLabel));
    }
    ]]>
                                
                            
                        
                    
                
                
                    
                        
                            

                                
                                     override public function set data(value:Object):void
    {
    Super.Data = value;
    var prevSelectedItem:Object = this.selectedItem;
    this.dataProvider = data.cityData;
    this.selectedItem = prevSelectedItem;
    }
    ]]>
                                

                            
                        
                    
                
            
        
        
            
            
        

  • How to use the combobox control to filter datagrid in Flash Builder 4?

    Hello

    I worked through the TestDrive with Flash Builder 4 application and I would like to know how to filter a datagrid using a combobox control.  I googled the subject and results for many different versions of Flash, some who look like they're going to take a considerable amount of time to implement.  I hope, with Flash Builder 4, there is a simple way to do this without writing code pages.

    I think I can be close to getting this work by passing the combobox value in a PHP script that queries the database with a WHERE clause.

    Thakns,

    David

    On the change of the ComboBox, you can filter on the ArrayCollection.source that contains the data. And define the table filtered as the dataprovider for a datagrid. Take a look at the function of class filter Array.

    -Gerard

    http://www.gauravj.com/blog

  • Flex 3: data of the ComboBox should appear in different colors:

    Hello

    I use ArrayCollection as a DataProvider collection to my Flex 3 Combobox component.


    Please tell me how to make the data in the COmbobox to appear in different colors?

    Indicate if you please, thank you.

    Custom itemRenderer

  • Null reference during the passage of the combobox as an argument

    I have a function that takes a ComboBox as a parameter and then fills.  This works fine on 3 of my comboboxes, but not on others.  For all others, he says they are null.

    Function code is here:

    protected void PopulateDateDropdowns (): void
    {
    PopulateMonths (cmbTDCTSinceMM);
    PopulateDays (cmbTDCTSinceDD);
    PopulateYears (cmbTDCTSinceYYYY);

    PopulateMonths (cmbEmpStartDateMM);
    PopulateDays (cmbEmpStartDateDD);
    PopulateYears (cmbEmpStartDateYYYY);

    PopulateMonths (cmbJEmpStartDateMM);
    PopulateDays (cmbJEmpStartDateDD);
    PopulateYears (cmbJEmpStartDateYYYY);
    }

    private void PopulateDays (cb:spark.components.ComboBox): void
    {
    var i: int;
    cb.dataProvider = new ArrayList();
    for (i = 1; i < 32; i ++)
    {
    cb.dataProvider.addItem (i);
    }
    }

    private void PopulateMonths (cb:spark.components.ComboBox): void
    {
    cb.dataProvider = new ArrayList();
    cb.dataProvider.addItem ("Jan");
    cb.dataProvider.addItem ("Feb");
    cb.dataProvider.addItem ("Mar");
    cb.dataProvider.addItem ("Apr");
    cb.dataProvider.addItem("May");
    cb.dataProvider.addItem ("may");
    cb.dataProvider.addItem ("July");
    cb.dataProvider.addItem ("Aug");
    cb.dataProvider.addItem ("MS");
    cb.dataProvider.addItem ("Oct");
    cb.dataProvider.addItem ("Nov");
    cb.dataProvider.addItem ("Dec");
    }

    private void PopulateYears (cb:spark.components.ComboBox): void
    {
    var i: int;
    var maxYear:int = new Date () .getFullYear () - 18;
    cb.dataProvider = new ArrayList();

    for (i = 1900; i < maxYear; i ++)
    {
    cb.dataProvider.addItem (i);
    }
    }

    Declaration of the comboboxes that fail is here:

    < mx:FormItem label = "Start Date:" direction = "horizontal" >
    < s:ComboBox id = "cmbEmpStartDateMM" width = "60" / >
    < s:ComboBox id = "cmbEmpStartDateDD" width = "60" / >
    < s:ComboBox id = "cmbEmpStartDateYYYY" width = "100" / >
    < / mx:FormItem >

    The only difference between these and those who work, is that they are declared within a distinct form and canvas.  But I thought the script was overall for the elements of the page.

    Ultimately when you use multiple views with their own playground, do not assume they are available, even after loading the application. That's why you should use data binding to power the data for them and not worry.

  • Filtering XML data in the grid

    I can't sem to figure out how to filter my XML data before entering my data grid. I want to load only the XML data with the ID 'BALUSTER' attribute and have tried to enter:

    data_grid. DataProvider dp =. (@ID IS 'BALUSTER');

    in my function xmlLoaded without success.  I'm fairly new to as3 and could certainly use the help.  Thank you.

    var dpataProvider;
    var products_xml:XML;
    var xmlReq:URLRequest = new URLRequest("data/products.xml");
    var xml_loader:URLLoader = new URLLoader();

    function xmlLoaded(event:Event):void {}
    var ldr:URLLoader = event.currentTarget as URLLoader;
    var xmlDP:XML = new XML (ldr.data);
    DP = new DataProvider (xmlDP);
    data_grid. DataProvider = dp;
    }

    xml_loader. Load (xmlReq);
    xml_loader.addEventListener (Event.COMPLETE, xmlLoaded);

    Assign the filtered data (not the original) to the data provider:

    function xmlLoaded(event:Event):void {}
    var ldr:URLLoader = event.currentTarget as URLLoader;
    var xmlDP:XML = new XML (ldr.data);
       
    var data: XML = ;
        data.setChildren (xmlDP.PRODUCTS. (@ID) IS 'BALUSTER'));
       
    DP = new DataProvider (data);
    data_grid. DataProvider = dp;
    }

Maybe you are looking for