ComboBox XML Data Provider

Hello all,
I'm having trouble creating an XML data provider to use for a
ComboBox. Below is what I've done:
XML data I get from Rails server:
<states>
<state name="Arizona" id="1" />
</states>
CDATA:
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
[Bindable] private var stateData:ArrayCollection;
private function getStates(event:ResultEvent):void {
stateData = (event.result as XML).states.state;
state.dataProvider = stateData;
state.labelField = "name";
state.data = "id";
<mx:ComboBox id="state" />
This compiles, but when I run it, I don't get anything in the
ComboBox. I know I'm getting data from the server, because I can
set the data provider for the ComboBox to be event.result and I see
all the resulting XML in the ComboBox.
Please help!!! What am I doing wrong here?!
Thanks in advance! -- BTR

Hey Vygo,
Thanks for the suggestion. I'll try it out and let you know
how it goes. However, I was worried about the attributes so I tried
it using regular elements as well, but to no avail. Anyway, I'll
get back to you once I have a chance to try out your suggestion.
Thanks again! -- BTR

Similar Messages

  • Hi to all... What is a  XML data provider,stored Procedure, personal data

    Hi to all... What is a  XML data provider,stored Procedure, personal data providers in deski.  when we use these data provider in desk top intelligence.. and use of it.
    Please give detail description of the above...
    Thanks for reply..........

    Hi,
    We can create Desktop Intelligence reports using XML Data Provider, Personal Data Files and Stored Procedure.
    Following is some detailed information about these three.
    Xml data provider:
    Xml data provider is used for the integration of external data sources stored in XML format.
    This is similar to HTML.
    Stored Procedure:
    A stored procedure is a set of SQL commands that has been compiled and stored on the database server.
    Once the stored procedure has been "stored", client applications can execute the stored procedure over and over again without sending it to the database server again and without compiling it again.
    Stored procedures improve performance by reducing network traffic and CPU load.
    Personal data files:
    u2022     *.prn files
         A PRN file is a special type of file which contains instructions for a printer, it tells the printer what to print on the page and where as well as which paper tray to use, what the paper size is and a number of other controls.
    u2022     *.asc files
          Between the values of a row any number of carriage returns  or blanks are allowed. In any case it is strongly recommended that the data table be stored in such a way that it can be read and edited easily.
           The values may be stored in any format (integer, floating point, exponential notation) and they must be separated at least by one blank. The class information must be of integer type, the row identifiers are interpreted as strings. The lines can have any length and must not contain any comment.
    u2022     *.csv files
    A CSV file is a specially formatted plain text file which stores spreadsheet or basic database-style information in a very simple format, with one record on each line, and each field within that record separated by a comma.
    Regards,
    Pradnya Kokil

  • XML Data Provider - Information

    Hi!
    I am using the web item "Data Provider - Information" in the WAD to get a query result in XML. When i choose view source in the explorer i can see the XML generated.
    My problem is that this generated XML generates one "XML set" for the characteristics in the query and one "XML set" for the key figures in the query.
    By this i mean that when i copy the xml from the "view source" file and save it as its own XML file i have to save it as one file for the Key Figures and one file for the Characteristics.
    Like this(Characteristic OMaterial and KeyFiure NetValue):
    <?xml version="1.0" encoding="iso-8859-1"?>
    <item>
    <material>12345</material>
    </item>
    and
    <?xml version="1.0" encoding="iso-8859-1"?>
    <item>
    <net_value>100</net_value>
    </item>
    I would like the web item to generate a XML file that includes both the KeyFigures and the Characteristics.
    Like this:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <item>
    <material>12345</material>
    <net_value>100</net_value>
    </item>
    Do any of you know if/how this is possible?
    Thanks,
    Charlotte

    Hey, sounds like you're getting pretty close. The next thing is integrating the XSLT transform into a web template. I'm actually working on a paper on this that I'll put out at some point. Anywho, here's a sample template that does the XSLT transform on load of the page... The most important thing is that the web template has property "STATELESS=X" so that any navigation you do reruns the transform. This way, you can still navigate and do BW type activities while still transforming the result set. This is very powerful and you'll be able to change or do anything using XSLT transforms. I'm even working on creating javascript functions that run these transforms to do left outer joins and inner joins based on 2 XML result sets. This way, even if data isn't modeled together, it can be presented together. I'm working through the kinks of some of these transforms. Also, I'm working to integrate stylesheet support into my transform as well. Just substitute your transform into the sample template below and it'll render an html table for the XML Query Result Set.
    [code]
    <HTML>
    <!-- BW data source object tags -->
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_DATA_PROVIDER"/>
             <param name="NAME" value="DATAPROVIDER_1"/>
             <param name="DATA_PROVIDER_ID" value="ZV_STAT_CUBE_VIEW"/>
             DATA_PROVIDER:             DATAPROVIDER_1
    </object>
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_PROPERTIES"/>
             <param name="TEMPLATE_ID" value="ZPD_STAT_XSL_3"/>
             <param name="STATELESS" value="X"/>
             TEMPLATE PROPERTIES
    </object>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
    <TITLE>BW Web Application</TITLE>
    <link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
    </HEAD>
    <script language="JavaScript">
          function loadIt() {
            XMLQUERYVIEWDATA_1.async = false;
    xsl_result_1.innerHTML = XMLQUERYVIEWDATA_1.transformNode(xsl_transform_1.documentElement);     
    alert(XMLQUERYVIEWDATA_1.transformNode(xsl_transform_1.documentElement));
        </script>
    <body onLoad="loadIt()">
    <P>
      <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="TABLE_1"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
             <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
             ITEM:            TABLE_1
    </object>
      <BR>
      <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="XMLQUERYVIEWDATA_1"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_XML_QUERYVIEW"/>
             <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
             <param name="NAVIGATIONAL_STATE" value=""/>
             <param name="RESULT_SET" value="X"/>
             ITEM:            XMLQUERYVIEWDATA_1
    </object>
    </P>
    <!--
    #==========================================================================
    XSL Transformation that displays
    Template Properties, List of Data Providers and List of Items
    #==========================================================================
    -->
    <xml id="xsl_transform_1">
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="header">
    <tr bgcolor="white"> <xsl:for-each select="//RRWS_SX_TUPLE[1]/*">
      <td>
      <xsl:value-of select="local-name()"/>
      </td>
    </xsl:for-each>
    </tr>
    </xsl:variable>
    <xsl:template match="/">
    <table bgcolor="gold" border="1">
    TESTVALUE -
    <tr>
      <xsl:copy-of select="$header" /> <xsl:apply-templates />
    </tr>
    <xsl:for-each select="//RRWS_SX_TUPLE">
          <tr>
            <td><xsl:value-of select="TUPLE_ORDINAL"/></td>
              <xsl:for-each select="//RRWS_S_CELL">           
              <td><xsl:value-of select="CELL_ORDINAL"></td>
              </xsl:for-each>
            <td><xsl:value-of select="TUPLE_ORDINAL"/></td>
            <td><xsl:value-of select="CHANM"/></td>
            <td><xsl:value-of select="CAPTION"/></td>
            <td><xsl:value-of select="CHAVL"/></td>
            <td><xsl:value-of select="CHAVL_EXT"/></td>
            <td><xsl:value-of select="NIOBJNM"/></td>
            <td><xsl:value-of select="TLEVEL"/></td>
            <td><xsl:value-of select="DRILLSTATE"/></td>
            <td><xsl:value-of select="OPT"/></td>
            <td><xsl:value-of select="SIGN"/></td>                    
            <td><xsl:value-of select="ATTRIBUTES"/></td>     
          </tr>
    <xsl:for-each select="//RRWS_S_CELL">
         <tr>     
            <td><xsl:value-of select="CELL_ORDINAL"/></td> 
            <td><xsl:value-of select="VALUE"/></td>            
            <td><xsl:value-of select="FORMATTED_VALUE"/></td> 
            <td><xsl:value-of select="VALUE_TYPE"/></td> 
            <td><xsl:value-of select="CURRENCY"/></td> 
            <td><xsl:value-of select="UNIT"/></td> 
            <td><xsl:value-of select="MWKZ"/></td> 
            <td><xsl:value-of select="NUM_SCALE"/></td> 
            <td><xsl:value-of select="NUM_PREC"/></td> 
            <td><xsl:value-of select="CELL_STATUS"/></td> 
            <td><xsl:value-of select="BACK_COLOR"/></td> 
         </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    <xsl:template match="RRWS_S_CELL/*">
    <td> <xsl:value-of select="." /> </td>
    </xsl:template></xsl:stylesheet>
    </xml>
    <table>
      <tr><td valign="top"><div id="xsl_result_1"></div></td></tr>
    </table>
    </body>
    </HTML>
    [/code]

  • UIX with XSQL as XML data provider and event handler

    Hello ,
    I would like to bind XML data to messageinput elements of a form element
    as values to be presented before entering (data provider)
    as well as input values to be persisted after completing the form (event handler).
    My impression (as a newbee) is that only for BC4J integration there is a bidirectional binding with view objects.
    Can i use 'include' to bind a static xml file as data source for output?
    How can i use XSQL to be bound as data for input as well as for output of a form?
    A last question concerning a page with 3 tabs:
    do i need 3 different pages and requests to get the data of the 3 tabs
    or is it possible to get the whole data of the page in one request
    and distribute it over the 3 tabs.
    Any help appreciated
    Thanks
    Klaus Dreistadt

    You could do this, but we don't provide any tools to make this easy.
    You'd have to write an implement of the DataObject interface
    that gives your UI access to the XML document, and write custom
    event handlers to perform the "set" side of things. The Data Binding
    and UIX Controller chapters of the UIX developer's guide will give you
    a high-level view of how to accomplish this, but nothing specifically
    about reading or writing to XML documents.

  • ComboBox and data provider

    hi,
    i need to populate a combo box with values form an
    ArrayColection that contains objects, how can i sepecify the field
    of each object in the array that should be displayed in the combo
    box ??
    cheers,
    jaimon

    Using the labelField property of the ComboBox.
    For further information please refer to the language
    reference, this contains all the properties of all the Flex
    components and how they are used.
    http://livedocs.macromedia.com/flex/2/langref/index.html

  • How to register/configure a Data Provider with Crystal Report Designer

    Hi,
    Iu2019m in the process of developing an ADO .Net XML Data Provider which works with Data Sets. I want to use this custom Data Provider through Crystal Report Designer 2008 so that I can access it from the u201CStandard Report Creation Wizard\Available Data Sourcesu201D section. How can I do this? I read the following in the u201Ccreating custom adddins.docu201D documentation.
    u201CCrystal Reports (CR) 2008 installs a new managed dll called DotNetExternalCommandAdapter.DLL and installs it into the Global Assembly Cache (GAC).  CR 2008 uses this dll to search and load files with a csc prefix in CR 2008u2019s AddIns subdirectory in a similar way it looks for database drivers, export drivers and UFLs. To create an Add-In the developer needs to reference this dll and inherit two classes from it, ICommand and ICommandDLL.u201D
    I have the following questions,
    1) As it mentions above how can I make Crystal find my custom Data Provider when it searches for the database drivers?
    2) Is there another class I can inherit from when creating my custom data provider? If so where can I find some documentation regarding this?
    3) Can I register my custom data provider in to the GAC and will Crystal find it if so how can I register my custom Data Provider? Will GACUtil work for Crystal as well?
    Thanks in Advance,
    Regards,
    Chanaka

    Baron, thank you for providing that link.
    Chanaka see if that article helps you out. It should - had I got to this thread earlier, I'd have sent that link also. Certainly DE place to start.
    Ludek

  • Data provider selection

    Evening
    I'm attempting to create a data provider selection drop down box. The box should allow selection of one of many external XML documents, which when selected, fills in the datagrid below.
    So far I've got the XML documents set up, and have been able to link them with the main project
    I've got the datagrid working nicely with both sizes and behaviours, and displaying data properly
    I've got a drop down working (heheh)
    It's the part where the drop down displays the list of XML docs and allows me to select them as the datagrid data provider that has me stumped.
    I wonder if anyone would be kind enough to point me in the direction of a tutorial, or example code that would allow me to do this. I've had a browse, but can't think of any other terms to use besides the obvious (XML, data provider, data provider selector, data provider selection etc).
    I'm also wondering if what I'm attempting is maybe more complicated than I think, which may be why I haven't stumbled upon anything specific yet.
    All the best,
    Mag
    P.S. I am new also, which I think may be obvious by the question    Flex looks too useful to pass up learning, so it's time to take the plunge I think.

    Morning. Sorry. It seems I said a lot but didn't explain very well. My fault
    Thank you both for your replies. I think I should have explained from the point of view of the app actually running.
    So imagine you run the app in your browser, and you see one datagrid, and one drop down box. Inside the drop down is a choice of XML files. Selecting XML file 1, will display the XML1's info in the datagrid. Selecting XML2 will display XML2's info in the datagrid and so on.
    It's creating that drop down that allows me to select XML files for the datagrid to use while the app is running that is my stumbling block.
    I'm familiar with the XML structure and how to display the info correctly inside the datagrid if the XML file is static.
    I am however unsure how to go about being able to select an alternative XML file for the grid to use while the app is running - this is what I'd like to find out how to learn.
    All the best,
    Mag

  • How to change the data provider of the tree with the selection of combobox

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

  • Using HTTPService as data provider for mx:ComboBox

    Hello all,
    I'm trying to use an HTTPService as a data provider for an
    mx:ComboBox. Here's how I have my HTTPService configured:
    <mx:HTTPService id="listStates" url="
    http://localhost:3006/state/list"
    useProxy="false" method="GET" />
    I have a Rails backend setup and talking to a database on my
    local machine. I have a list of states in a table in my database,
    and the table has two columns: id and name. When I go to
    localhost:3006/state/list in my browser, I get the following XML:
    <states>
    <state>
    <id type="integer">1</id>
    <name>New Mexico</name>
    </state>
    <state>
    <id type="integer">2</id>
    <name>Arizona</name>
    </state>
    </states>
    I have my mx:ComboBox set up like so:
    <mx:ComboBox width="199" id="state" dataProvider="{
    listStates.lastResult.states.state }" />
    However, when I browse to my .swf file, my state combo box
    shows [object Object] twice in the drop-down list. Anyone have any
    idea why it's not parsing the data correctly? Any suggestions on
    how to make it work?
    Thanks in advance!!! -- BTR

    Alright I worked one out for you. Let me know if you have any
    questions.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="dropDown.send()">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    public var dropArr:XML;
    public function get_drop_down(e:ResultEvent):void{
    dropArr = e.result as XML;
    state.dataProvider = dropArr.state;
    state.labelField = "name";
    state.data = "id";
    ]]>
    </mx:Script>
    <mx:HTTPService id="dropDown" useProxy="false"
    url="
    http://localhost/dropDown.php"
    resultFormat="e4x"
    result="get_drop_down(event)" />
    <mx:ComboBox width="199" id="state" />
    </mx:Application>

  • Change Data Provider Based on ComboBox Selection

    Complete noob using Flash CS5 for Macs. I have a ComboBox component and a TileList. I want the ComboBox selection to change the data provider for the TileList. I've used a sample script from the Adobe website at the bottom, but it is not working in this context. Google returns no better examples. Can anyone point me in the right direction?
    import fl.controls.ComboBox;
    import fl.data.DataProvider;
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import fl.events.DataChangeEvent;
    // Combo Box ("aCb")
    var aCb:ComboBox = aCb;
    var Choices:Array = new Array(
        {label:"Artist Resin", data: "resin"},
        {label:"Ceramic", data: "ceramic"}
    aCb.dataProvider = new DataProvider(Choices);
    // TileList ("aTl")
    aTl.columnWidth = 110;
    aTl.rowHeight = 130;
    aTl.setSize(110,150);
    aTl.move(20, 150);
    aTl.setStyle("contentPadding", 5);
    // TileList Content
    var i:uint = 0;
    var resinitems:Array = [
    {label: "Image 1", source: "http://www.helpexamples.com/images/montreal/images/IMG_5057.jpg"},
    {label: "Image 2", source: "http://www.helpexamples.com/flash/images/gallery2/images/IMG_1592.jpg"}];
    var resin:DataProvider = new DataProvider();
    for(i=0; i < resinitems.length; i++) {}
    var ceramicitems:Array = [
    {label: "Image 3", source: "http://www.helpexamples.com/flash/images/gallery1/images/pic11.jpg"},
    {label: "Image 4", source: "http://www.helpexamples.com/flash/images/gallery1/images/pic14.jpg"},];
    var ceramic:DataProvider = new DataProvider();
    for(i=0; i < ceramicitems.length; i++) {}
    addChild(aCb);
    addChild(aTl); 
    // Code to Change Data Provider for Tile List
    aCb.addEventListener(Event.CHANGE, changedataProvider);
    function changedataProvider(event:Event):void {
        aTl.dataProvider = event.target.selectedItem.data;

    Thanks for your answers.
    I have already checked those links.
    Now th problem what I am facing is,
    I am not able to call the function ChangeLanguage through javascript.
    I have created a dropdwon using Hovermenu and added English and German.
    Now when I click on these the function should be called.
    Please help me in getting how setClientSideScript() can be used to call a function.
    or any other way to call the function after clicking on Hovermenu Item.
    Thanks in advance,
    Sumangala

  • Error using an XML as data provider for either datagrid or linechart

    Hi,
    I am developing an application using Flex and Java servlets.
    Upon user
    event, I load the data using the servlet and store the data
    in a
    Dictionary. I am running into couple of issues from here
    a. If I try to use the XML object in the dictionary as the
    data provider
    for either Datagrid or Linechart I am unable to view the
    data. I did a
    trace on the object and it has the correct data.
    b. Also, I am unable to access the content of child elements
    when using
    a parent element as the data provider.
    ex. parent. child1. child2 does not work, it works when I
    provide child2
    as the dataprovider directly.
    Please let me know what might be the root causes and
    resolutions.
    Thanks in advance,
    Nataraj

    I did not find a solution to the problem and created a list
    of the child objects and used that as the source instead of the top
    level XML object. This worked.

  • Populating ComboBox with XML data

    Hi there,
    Probably the most basic question, but I'm having a hard time with this...
    Trying to populate the ComboBox with XML data as a dataProvider.
    Here is the code snippet:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical"
                    creationComplete="baseDataRequest.send()">
        <mx:Script>
            <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.rpc.events.ResultEvent;
                [Bindable]
                private var baseDataXML:XML;
                private function baseResultHandler(event:ResultEvent):void
                    baseDataXML = event.result.node.child as XML;
            ]]>
        </mx:Script>
        <mx:HTTPService id="baseDataRequest"
                        useProxy="false"
                        resultFormat="e4x"
                        result="baseResultHandler(event)"
                        url="XML_URL"/>
        <mx:ComboBox id="comboDemo"
                     width="390"
                     dataProvider="{baseDataXML}"
                     labelField="NodeName"/>
    </mx:Application>
    And that returns nothing, basically. I know the XML is being pulled, because if I do this:
    baseDataXML = event.result as XML;
    then I just see a single item in my ComboBox, with full XML content.
    How do I populate the ComboBox with XML contents?
    XML example:
    <root>
        <node>          <child>Child1</child>
              <child>Child2</child>
         </node>
    </root>
    Question: how do I populate the ComboBox with XML data nodes? I need <child> content to be the labelField of each combo box item...
    Thanks!
    K

         <mx:Script>
              <![CDATA[
                   var baseDataXML:XML = <root><node><child>Child1</child><child>Child2</child></node></root>;
              ]]>
         </mx:Script>
         <mx:ComboBox id="comboDemo"
                     width="390"
                     dataProvider="{baseDataXML.node.child}"
                     labelField="NodeName"/>
    Don't do:
    baseDataXML = event.result.node.child as XML;
    Instead just do:
    baseDataXML = XML(event.result);
    And in your combo:
    dataProvider="{baseDataXML.node.child}"

  • Little help with complex XML data as data provider for chart and adg

    Hi all,
    I've been trying to think through a problem and Im hoping for
    a little help. Here's the scenario:
    I have complex nested XML data that is wrapped by subsequent
    groupings for efficiency, but I need to determine if each inner
    item belongs in the data collection for view in a data grid and
    charts.
    I've posted an example at the bottom.
    So the goal here is to first be able to select a single
    inspector and then chart out their reports. I can get the data to
    filter from the XMLListCollection using a filter on the first layer
    (ie the name of the inspector) but then can't get a filter to go
    deeper into the structure in order to determine if the individual
    item should be contained inside the collection. In other words, I
    want to filter by inspector, then time and then tag name in order
    to be able to use this data as the basis for individual series
    inside my advanced data grid and column chart.
    I've made it work with creating a new collection and then
    looping through each time there is a change to the original
    collection and updating the new collection, but that just feels so
    bloated and inefficient. The user is going to have some buttons to
    allow them to change their view. I'm wondering if there is a
    cleaner way to approach this? I even tried chaining filter
    functions together, but that didn't work cause the collection is
    reset whenever the .refresh() is called.
    If anyone has experience in efficiently dealing with complex
    XML for charting purposes and tabular display purposes, I would
    greatly appreciate your assistance. I know I can get this to work
    with a bunch of overhead, but I'm seeking something elegant.
    Thank you.

    Hi,
    Please use the code similar to below:
    SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
    SORT IT_DO_NOT_LOAD by WBS_Key.
        IF SOURCE_PACKAGE IS NOT INITIAL.
          IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
    LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
            V_SYTABIX = SY-TABIX.
            READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
            WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
            BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
              DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
            ENDIF.
    ENDIF.
          ENDLOOP.
          SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
        ENDIF.
    -Vikram

  • ActionScript to bind XML data to components

    How can I use ActionScript to bind XML data to a comboBox
    component instead of using the component inspector? (I have done
    the latter, successfully, but that doesn’t allow access to
    the code - .)
    My ActionScript so far imports the data (the trace picks it
    up) – but the ‘cbType.dataProvider line’
    doesn’t work. It works when I change the data provider to an
    array – so what am I doing wrong?
    MY CODE:
    import mx.data.components.XMLConnector;
    var xcFestival:XMLConnector = new XMLConnector();
    xcFestival.ignoreWhite = true;
    xcFestival.direction = "receive";
    xcFestival.URL = "festivalItems.xml";
    xcFestival.trigger();
    //POPULATE THE COMPONENTS WITH THE DATA
    var festXMLlistener:Object = new Object();
    festXMLlistener.result = function(evt:Object) {
    trace(xcFestival.results);
    cbType.dataProvider = xcFestival.results;
    xcFestival.addEventListener("result",festXMLlistener);

    This is on a stand - alone system
    Using Designer ES ......
    I saved the Form as an xdp form
    and it seems as if all goes well until
    View the data and nothing appears - or
    just the names of the fields appear

  • DataGrid does not display XML data

    Hello, and thanks for reading this...
    I am having a problem displaying XMLList data in a DataGrid.
    The data is coming from a Tree control, which is receiving it
    from a database using HTTPService.
    The data is a list of "Job Orders" from a MySQL database,
    being formatted as XML by a PHP page.
    If it would be helpful to see the actual XML, a sample is
    here:
    http://www.anaheimwib.com/_login/get_all_orders_test2.php
    All is going well until I get to the DataGrid, which doesn't
    display the data, although I know it is there as I can see it in
    debug mode. I've checked the dataField property of the appropriate
    DataGrid column, and it appears correct.
    Following is a summary of the relevant code.
    ...An HTTPService named "get_all_job_orders" retrieves
    records from a MySQL database via PHP...
    ...Results are formatted as E4X:
    HTTPService resultFormat="e4x"
    ...An XMLListCollection's source property is set to the
    returned E4X XML results:
    ...The "order" node is what is being used as the top-level of
    the XML data.
    <mx:XMLListCollection id="jobOrdersReviewXMLList"
    source="{get_all_job_orders.lastResult.order}"/>
    ...The "jobOrdersReviewXMLList" collection is assigned to be
    the dataProvider property of a Tree list, using the @name syntax to
    display the nodes correctly, and a change event function is defined
    to add the records to a DataGrid on a separate Component for
    viewing the XML records:
    <mx:Tree dataProvider="{jobOrdersReviewXMLList}"
    labelField="@name"
    change="jobPosForm.addTreePositionsToDG(event)"/>
    ...Here is the relevant "jobPosForm" code (the Job Positions
    Form, a separate Component based on a Form) :
    ...A variable is declared:
    [Bindable]
    public var positionsArray:XMLList;
    ...The variable is initialized on CreationComplete event of
    the Form:
    positionsArray = new XMLList;
    ...The Tree's change event function is defined within the
    "jobPosForm" Component.
    ...Clicking on a Tree node fires the Change event.
    ...This passes an event object to the function.
    ...This event object contains the XML from the selected Tree
    node.
    ...The Tree node's XML data is passed into the positionsArray
    XMLList.
    ...This array is the dataProvider for the DataGrid, as you
    will see in the following block.
    public function addTreePositionsToDG(event:Event):void{
    this.positionsArray = selectedNode.positions.position;
    ...A datagrid has its dataProvider is bound to
    positionsArray.
    ...(I will only show one column defined here for brevity.)
    ...This column has its dataField property set to "POS_TITLE",
    a field in the returned XML record:
    <mx:DataGrid width="100%" variableRowHeight="true"
    height="75%" id="dgPositions"
    dataProvider="{positionsArray}" editable="false">
    <mx:columns>
    <mx:DataGridColumn width="25" headerText="Position Title"
    dataField="POS_TITLE"/>
    </mx:columns>
    </mx:DataGrid>
    In debug mode, I can examine the datagrid's dataProvider
    property, and see that the correct XML data from the Tree control
    is present. However, The datagrid does not display the data in any
    of its 6 columns.
    Does anyone have any advice?
    Thanks for your time.

    Hello again,
    I came up with a method of populating the DataGrid from the
    selected Item of a Tree Control which displays complex XML data and
    XML attributes. After the user clicks on a Tree branch, I call this
    function:
    public function addTreePositionsToDG(event:Event):void{
    //Retrieve all "position" nodes from tree.
    //Loop thru each Position.
    //Add Position data to the positionsArray Array Collection.
    //The DataGrid dataprovider is bound to this array, and will
    be updated.
    positionsArray = new ArrayCollection();
    var selectedNode:Object=event.target.selectedItem;//Contains
    entire branch.
    for each (var position:XML in
    selectedNode.positions.position){
    var posArray:Array = new Array();
    posArray.PK_POSITIONID = position.@PK_POSITIONID;
    posArray.FK_ORDERID = position.@FK_ORDERID;
    posArray.POS_TITLE = position.@POS_TITLE;
    posArray.NUM_YOUTH = position.@NUM_YOUTH;
    posArray.AGE_1617 = position.@AGE_1617;
    posArray.AGE_1821 = position.@AGE_1821;
    posArray.HOURS_WK = position.@HOURS_WK;
    posArray.WAGE_RANGE_FROM = position.@WAGE_RANGE_FROM;
    posArray.WAGE_RANGE_TO = position.@WAGE_RANGE_TO;
    posArray.JOB_DESCR = position.@JOB_DESCR;
    posArray.DES_SKILLS = position.@DES_SKILLS;
    positionsArray.addItem(posArray);
    So, I just had to manually go through the selected Tree node,
    copy each XML attribute into a simple Array, then ADD this Array to
    an ArrayCollection being used as the DataProvider for the DataGrid.
    It's not elegant, but it works and I don't have to use a Label
    Function, which was getting way too complicated. I still think that
    Flex should have an easier way of doing this. There probably is an
    easier way, but the Flex documentation doesn't provide an easy path
    to it.
    I want to thank you, Tracy, for the all the help. I checked
    out the examples you have at www.cflex.net and they are very
    helpful. I bookmarked the site and will be using it as a resource
    from now on.

Maybe you are looking for

  • How much does it takes normally to get a respond from Apple?

    I made an In-App Purchase 4 days ago and my Purchase did not delivered. So I in past few days I tried to reach Apple support team via link provided in my Receipt and itunes Support site 2 times with 48 hours delay each time,Both time I received an em

  • I don't know how to check my itunes account balance

    I redeemed 3 gift cards and I don't know how much I have left.  I'm logged into my account, but it only shows my account name and not the balance. When I use my password to log into the account, to manage it, it still shows no balance anywhere.  Wher

  • Artifact Lines in Line Pattern Swatch

    Hi, I am trying to use a basic line pattern swatch as a fill. It all looks fine in Illustrator but when I go and try to save it under "save to web and devices" the fill pattern shows extra lines in the pattern. These lines are darker and run in a dif

  • Hi, where can I download the adobe media server setup file?

    same as above.

  • Double click snapshot nothing happens

    Just upgraded to CS5. In CS5 Bridge when I double click a snapshot in the filmstrip it doesn't open that image in Camera Raw. It did in CS4. I thought there was a selection in preferences to do this, but, I don't see it.. Don