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

Similar Messages

  • How to creat a Data provider  based on different fields in SAP BW ?

    Hi,
    Experts,
    There are  20 fields  of  Plant Maintainace  like : 
    SWERK
    BEBER
    STORT
    TPLNR
    EQUNR
    INGRP
    QMDAT   ---peroid
    STTXT
    QMDAT  - Date of Notification
    QMNUM
    QMTXT
    QMART
    AUSVN
    AUZTV
    AUSBS
    AUZTB
    AUSZT
    ERNAM
    QMDAB
    AUFNR
    I  want to creat a  Report based upon these fields  ?
    For that I h'v  checked the relevant Fields to the   existing standard  Datasource  in Bw side   &
    Checked  cubes   created  based upon these Datasource  in Bw side !
    i h'v found  some fields are  existing different cubes & some are  missing .
    How to creat a Data provider  based on different fields in SAP BW ?
    plz suggest      !!!!!!!
    Thanx,
    Asit
    Edited by: ASIT_SAP on Jul 15, 2011 6:25 AM
    Edited by: ASIT_SAP on Jul 15, 2011 6:27 AM
    Edited by: ASIT_SAP on Jul 15, 2011 12:37 PM

    Hi Lee, Please see below..
    DECLARE @Machine2 TABLE
    DispatchDate DATE
    INSERT INTO @Machine2 VALUES ('2014/02/01'), ('2014/02/02'), ('2014/02/03')
    DECLARE @DateFrom DATE
    SELECT @DateFrom = DATEADD(D,1,MAX(DispatchDate)) FROM @Machine2
    SELECT @DateFrom AS DateFrom
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Hold variable values while changing data provider parameters in a template

    Dear experts,
    I have a problem in WAD. I have about 7 reports with 2 Queries each. Because of lower maintenance expenditure i would like to use only one web template. I created a dropdown item with a fixed option list. Every option represents one report and has two Set-Data-Provider Paramters commands which change the queries. It works fine but it can't hold the variables values. Example: every query contains the same variable (with suggestion value). If i insert a value into variable screen at the beginning and then use the dropdown-item to select another report, the next report is always calculated with the suggestion value of the variable (not with the typed in value at variable screen). How could i hand over this value to the next report/queries?
    If there is any solution whitout ABAP-programming i would prefer it.
    Kind regards
    Doris

    Dear experts,
    I have a problem in WAD. I have about 7 reports with 2 Queries each. Because of lower maintenance expenditure i would like to use only one web template. I created a dropdown item with a fixed option list. Every option represents one report and has two Set-Data-Provider Paramters commands which change the queries. It works fine but it can't hold the variables values. Example: every query contains the same variable (with suggestion value). If i insert a value into variable screen at the beginning and then use the dropdown-item to select another report, the next report is always calculated with the suggestion value of the variable (not with the typed in value at variable screen). How could i hand over this value to the next report/queries?
    If there is any solution whitout ABAP-programming i would prefer it.
    Kind regards
    Doris

  • Tablix Data mapping based on parameters selected.

    I ahve a report that is for variable based on the parameters selected. Parameter 1 is TableName, it lets the user select the table from the database that they would like to see the clolumns for. From there the second parameter is the Column names from the
    table that was selected. I can get the headers to show based on the selection but not the actual data.
    I've got this query that i created in SQL that works if input the parameters but i cannot figure out how to tie in the data to the report tablix.
    DECLARE @Column_Name VARCHAR(500)
    DECLARE @Table_Name VARCHAR(100)
    DECLARE @sql_str VARCHAR(500)
    SET @Column_Name = 'Id,Sort,Brand'
    SET @Table_Name = 'Item'
    SET @sql_str = 'Select ' + @Column_Name + ' FROM ' + @Table_Name
    --SELECT @sql_str
    EXECUTE (@sql_str)

    but i cannot figure out how to tie in the data to the report tablix.
    You can not dynamically assign the column to a text box (tablix). The best way is to modify your SQL to return the result with a fix column alias, then you can assign ths column to the Report control =>
    SET @sql_str = 'Select ' + @Column_Name + ' AS [ReportColumn] FROM ' + @Table_Name
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • 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 Template Logo based on the selected values...

    Hi All,
    It is possible to change the logo based on the values or company I've selected. Its for invoice template since we have multiple client. The management want to change logo every time they select specific company invoice. Thanks
    Whel

    yes..you can achieve with one conditional formatting report..I am Talking about OBIEE reports only not publisher thing
    1)upload all your images in /Images folder of server
    2)create one Report with Company name column,click edit Column properties--> conditional formatting--->add conditions as required like Company name ='Oracle'-->In format window select Image and select Custom Image -->fmap:images/oracle.jpg-->in default select "Image only" option-->repeat for all images-->Make this company column as "is prompted" -->save the Report-->put this report on the dash board where that company prompt is available...and see results :).I implemented it successfully

  • [MDX] Define date range based on user selection

    Hi All,
    I'm trying to define date range (of 3 months) using mdx based on user selection.
    This is what I'm trying to do:
    - If user select 2013, I would like range to be: from
    1 Oct 2013 to 31 Dec 2013
    - If user select Aug 2013, I would like range to be: from
    1 Jun 2013 to 31 Aug 2013
    - If user select 15 Sep 2013, I would like range to be : from
    15 Jul 2013 to 15 Sep 2013
    It is not a problem to get the upper bound of the range like this:
    ClosingPeriod(
    [Date].[Calendar].[Date],
    [Date].[Calendar].CurrentMember
    But I'm not able to get the lower bound of the range:
    OpeningPeriod(
    [Date].[Calendar].[Date],
    ParallelPeriod(
    [Date].[Calendar].[Month Number],
    2,
    ClosingPeriod(
    [Date].[Calendar].[Date],
    [Date].[Calendar].CurrentMember
    Error:If user selection is
    15 Aug 2013, I get
    14 Jun 2013
    If user selection is Apr 2013, I get
    (null)
    And even more strange, if user selection is
    2013, I get 28 Oct 2013
    Any idea of how to solve this ?
    Thanks,
    Guillaume

    Hello Guillaume,
    Can you please check if the following works for you? By the way, the performance will suffer due to all these IIF, the solution is very complex in order to avoid null in ParallelPeriod.
    with member measures.high as MemberToStr(ClosingPeriod(
       [Date].[Calendar].[Date],
       [Date].[Calendar].CurrentMember
    member measures.low as
    MemberToStr(
    iif(ClosingPeriod(
       [Date].[Calendar].[Date],
       [Date].[Calendar].CurrentMember
    ) IS ClosingPeriod(
       [Date].[Calendar].[Date],
       [Date].[Calendar].CurrentMember
    ).Parent.LastChild  --last date of the month
    OpeningPeriod(
       [Date].[Calendar].[Date],
    Ancestor(ClosingPeriod(
       [Date].[Calendar].[Date],
       [Date].[Calendar].CurrentMember
    ), [Date].[Calendar].[Month]).lag(2)
    iif([Date].[Calendar].CurrentMember.level is
    [Date].[Calendar].[Date]
    and
    Right(CSTR([Date].[Calendar].CurrentMember.Properties("KEY0")),4)="0429" --take care of 4/29
    OpeningPeriod(
       [Date].[Calendar].[Date],
    Ancestor(ClosingPeriod(
       [Date].[Calendar].[Date],
       [Date].[Calendar].CurrentMember
    ), [Date].[Calendar].[Month]).lag(2)
    OpeningPeriod(
       [Date].[Calendar].[Date],
       ParallelPeriod(
          [Date].[Calendar].[Month],
          2,
          ClosingPeriod(
             [Date].[Calendar].[Date],
             [Date].[Calendar].CurrentMember
    select  {measures.low,measures.high } on 0
    from [Adventure Works]
    where
    --[Date].[Calendar].[Date].&[20070815]
    --get [Date].[Calendar].[Date].&[20070615]
    --[Date].[Calendar].[Date].&[20070530]
    --get[Date].[Calendar].[Date].&[20070330]
    --[Date].[Calendar].[Date].&[20070429]
    --get [Date].[Calendar].[Date].&[20070201]
    --[Date].[Calendar].[Calendar Year].&[2007]
    --get [Date].[Calendar].[Date].&[20071001]
    --[Date].[Calendar].[Month].&[2007]&[4]
    --get [Date].[Calendar].[Date].&[20070201]
    --[Date].[Calendar].[Month].&[2007]&[5]
    --get [Date].[Calendar].[Date].&[20070301]
    --[Date].[Calendar].[Date].&[20070228]
    --get [Date].[Calendar].[Date].&[20061201]
    --[Date].[Calendar].[Date].&[20070831]
    --get [Date].[Calendar].[Date].&[20070601]
    If this does not work for you, I would suggest opening a ticket with Microsoft Support, with an advisory type of request.
    Hope this helps.
    Thanks.
    Meer Al - MSFT

  • Change submit destination based on form selection

    Is it possible to change the recipient of a form based on the info that was filled? for example
    checkbox A is selected -> form emailed to recipient A
    checkbox B is selected -> form emailed to recipient B
    checkbox A and B is selected -> form emailed to recipient A and B

    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

  • Pie Chart changing data provider ?

    Iv created a pie chart to which the dataprovider is often going to change , the problem is how can i draw the pie chart when the datprovider changes as currently the chart is drawn when the dataprovider hasnt been set and thereforee nothing is displayed?
    Thanks Chris

    <fx:Script>
            <![CDATA[
                import mx.rpc.events.ResultEvent;
                import mx.collections.XMLListCollection;          
                import mx.events.ListEvent;
                import mx.controls.Alert;
                [Bindable]
                public var stats_list:XMLList;
                [Bindable]
                public var stats_list_collection:XMLListCollection;
                //Handler for stats list xml.           
                public function stats_result(event:ResultEvent):void
                    stats_list=event.result.stats
                    stats_list_collection=new XMLListCollection(stats_list);                                                             
            ]]>
        </fx:Script>
    <mx:PieChart id="piechart" dataProvider="{stats_list_collection}" showDataTips="true" color="#000000" name="Dynamic Pie Chart" right="0" left="0" top="40" bottom="10">
                <mx:series>
                    <mx:PieSeries explodeRadius=".1" labelPosition="callout" displayName="Series 1" field="value" nameField="type" fills="{[sc1, sc2, sc3, sc4]}"/>
                </mx:series>
    </mx:PieChart>
    Chris,
    I posted some information above that might be of some use to you.  Note that my PieChart dataProvider is: stats_list_collection 
    When the function "stats_result" is triggered it changes the data for the PieChart and I reset the value of stats_list_collection.  When that happens it changes the PieChart to contain the new values from your XMLListCollection.  Basically the way this application was setup is to have a dropdown that a user selects and option from and it populates the data in the PieChart depending on their selection.
    Another way of doing this (if you don't want to just update the dataProvider's content) is:
    <fx:Script>
             <![CDATA[
                  //pseudo code
              var dataprovider1:SOMETYPE = SOMETHING;
              var dataprovider2:SOMETYPE = SOMETHING;
              var dataprovider3:SOMETYPE = SOMETHING;
                public function WHATEVER YOU WANT THE TRIGGER TO BE(event:ResultEvent):void
                        switch(SOME CONDITION)
                             case "case 1":    piechart.dataProvider = dataprovider1;
                                                      break;
                             case "case 2":    piechart.dataProvider = dataprovider2;
                                                      break;
                             case "case 3":    piechart.dataProvider = dataprovider3;
                                                      break;
             ]]>
         </fx:Script>
    <mx:PieChart  id="piechart">
                <mx:series>
                     <mx:PieSeries explodeRadius=".1" labelPosition="callout"  displayName="Series 1" field="value" nameField="type" fills="{[sc1, sc2,  sc3, sc4]}"/>
                </mx:series>
    </mx:PieChart>
    Hope this helps.  The secondary option I posted was mostly pseduo code but the idea should give you a starting point.

  • Change portal language based on user selection in masthead7.3

    Hi All,
    I am trying to provide the language drop down option in Portal Masthead.
    I have created the Hovermenu in Masthead which displayes 2 options(English and German)
    When user selects German, the portal should be loaded in german language.
    Can you please guide me with the proper event handler which should be called, on clicking Hovermenu Item.
    Which URL should be called on clicking Hovermenu Item.
    I have checked some SDN links already.
    Regards,
    Sumangala

    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

  • 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

  • Hiding columns in list based on prompt selection

    Hi,
    Question with me here is How to show the details only for selected Years in the prompts.
    Users have to select a range of years for which they want to see the data and based on this selection, the columns should appear. more importatnly, there are other surrounding columns which should appear always on the result screen (that restricts me to use pivot instead).
    e.g. Case 1 - User selected Year Range = 2011 to 2014 -
    Result set columns should be
    ID, CODE, DESC, VALUE_2011, VALUE_2012, VALUE_2013, VALUE_2014, Contact Person, Mail, Phone
    Case 2 - User selected Year Range = 2011 to 2016 -
    Result set columns should be
    ID, CODE, DESC, VALUE_2011, VALUE_2012, VALUE_2013, VALUE_2014, VALUE_2015, VALUE_2016, Contact Person, Mail, Phone
    Did anyone have a solution for such case?
    Thanks in advance.

    user1997473 wrote:
    Limitation I have is - I can not rearrange columns. I have to have initial few columns static, next few based on Years selected and last few static columns in same order. So I can not use pivot per my understanding. Any alternate approach?I don't understand your situation fully, but to answer your requirement, "I have to have...last few static columns in same order.," do this:
    1) Put the dimension columns you need at the end of the report in the Measures section, on the bottom.
    2) Change the Aggregation Rule to Max and the values will appear.
    So you can have dimension columns at the end of a pivot table; you just have to do a little trickery.

  • Query View name not saved in "Analysis Grid Properties" under Data Provider

    Hi BW World;)
    We are on BI 7.0
    I have created a BI workbook which contains a query view.
    However when we go into design mode and then "analysis grid properties" for this query view then "change data provider" it does not show the query view name but the query name. (we have saved the workbook)
    Is this the normal scenario?
    Surely should show the "query view name " and not the "query name" as confuses what data provider is being used?
    Is this a bug?
    Best
    Stevo.... Points of course... Thanks in advance.;)
    Edited by: bw4eva999 on Sep 10, 2009 4:40 PM     spelling

    Hi,
    You have created a workbook on top of a Query View which is again depends on a Query.Now the base for Query View is a Query.So the underlying Data Provider for a workbook is a Query.
    Hence when you go to Properties of grid->Change Data Provider,it shows the Query and the InfoCube,but not the Query View.
    So this is not a bug and this how its been designed.
    If you click for the Information of that workbook,it will show the Query and Info Provider,but not the query View.
    Though it looks like wierd,it is not a bug.
    Rgds,
    Murali

  • 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

  • Populating other fields in a form based on the selection in a combobox field

    We have done a form(masterdetail) in which we have a combobox field.When we make a selection in the field we require some two other fields to be automatically populated retrieving data from a table(which has the details required) based on the selection made.For eg. Selecting emp id(combobox) should populate empname and salary automatically in the form.Is this possible?If so how can this be done?
    Thanks & Regards,
    Jayanthi.S

    This is what I did following Michael's suggestion and it works fine :-
    1> Created a dynamic LOV named LOV_EMPNO as:-
    select empno,empno from scott.emp
    2> Started creating a form named FORM024_EMP2 on scott.emp.
    3> On reaching the Formatting and Validation section, I chose the EMPNO field in the left frame.
    In the right frame for EMPNO, I changed the item-type to Combobox and selected the lov LOV_EMPNO.
    Then I went to the Javascript handler section for EMPNO, chose the Javascript event onChange and in the
    adjacent Textarea, I wrote:-
    popdetails(this);
    We will create the javascript function popdetails() in the Additional pl/sql section.
    4> Click next and goto the Additional PL/SQL section and I wrote the following code in
    "...after displaying the page" area.
    (You can write this either in
    before displaying the page,
    before displaying the form,
    after displaying the form,
    after displaying the page).
    declare
    type tvcarr is table of varchar2(2000) index by binary_integer;
    l_empno_arr tvcarr;
    l_ename_arr tvcarr;
    l_sal_arr tvcarr;
    begin
    select empno,ename,sal
    bulk collect into
    l_empno_arr,l_ename_arr,l_sal_arr
    from scott.emp;
    htp.p('
    <script>
    var empdets = new Array();
    empdets[0] = new Array("","");
    for i in 1..l_empno_arr.count
    loop
    htp.p('empdets['||l_empno_arr(i)||'] = new Array("'||l_ename_arr(i)||'","'||l_sal_arr(i)||'");');
    end loop;
    htp.p('
    function popdetails(ele)
    var val = new Number();
    var thisform = ele.form;
    val = parseInt(ele.value);
    if (isNaN(val))
    val = 0;
    for (var i = 0; i < thisform.length; i++){
    if (thisform.name == "FORM024_EMP2.DEFAULT.ENAME.01")
    thisform[i].value = empdets[val][0];
    else if(thisform[i].name == "FORM024_EMP2.DEFAULT.SAL.01")
    thisform[i].value = empdets[val][1];
    htp.p('</script>');
    end;

Maybe you are looking for