Updating charts and datagrids based on selection

I am trying to find some documentation and samples explaining how I can pick something in a combobox and have it populate a series of datagrids and charts.
OUTLINE:
A.  Using an XML table of all municipalities in our region populate a combobox.  Then have the user select the municipality they are interested in.
B.Take a census table that is in XML format and by using HTTPServices read it into Flex and then based on what municipality the user selected populate a datagrid and variety of charts with data pertaining to the muni.
I know it is done because I see it all the time and took a class last week where it was shown.  Unfortunately it was the last day of the class and time was running out so we just got a brief overview of this.
I would greatly appriciate anyone who can point me to samples and documentation whether it be online or in books.  And I should mention that terminology is still an issue.  Am I attempting to do a custom event or what?
The code below all works.  What I mean I am successfully populating the combobox and the datagrid with the appropriate data.  I am just not able to get the two communicating with each other.  In other words the datagrid is showing the entire table and ignoring the combobox.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
creationComplete="initApp()">
<mx:Script>
  <![CDATA[
   import mx.rpc.events.*;
   import mx.controls.*;
   import mx.charts.*;
   import mx.collections.*;
   [Bindable]
   private var acMuni:ArrayCollection = new ArrayCollection;
   [Bindable]
   private var acCity:ArrayCollection = new ArrayCollection;
   private function initApp():void {
    muniHS.send();
    cityHS.send();
   private function eHandler(e:ResultEvent):void {
    acMuni = e.result.GetAllMUNIS.MUNIS;
   private function fHandler(e:FaultEvent):void {
    var faultInfo:String="fault code: "+ e.fault.faultCode +"\n\n";
    faultInfo+="fault string: "+e.fault.faultString+"\n\n";
    mx.controls.Alert.show(faultInfo,"Fault Information");
    var eventInfo:String="event target: "+e.target+"\n\n";
    eventInfo+="event type: "+e.type+"\n\n";
    mx.controls.Alert.show(eventInfo,"Event Information");
   private function eCityHandler(e:ResultEvent):void {
    this.acCity = e.result.GetCITIES.CITIES;
  ]]>
</mx:Script>
<mx:HTTPService id="muniHS"
  url="data/GetAllMunis.xml"
  result="eHandler(event)"
  fault="fHandler(event)"
  showBusyCursor="true"/>
<mx:HTTPService id="cityHS"
  url="data/CityNames.xml"
  resultFormat="object"
  result="eCityHandler(event)"
  fault="fHandler(event)"
  showBusyCursor="true"/>
<mx:Panel width="100%" height="50%"
  paddingBottom="10"
  paddingLeft="10"
  paddingRight="10"
  paddingTop="10" title="DataGrid">
<mx:ComboBox id="muniCB"
  dataProvider="{acCity}"
  prompt="Select a Municipality"
  labelField="city"/>
  <mx:DataGrid id="dg"
   width="100%"
   height="100%"
   dataProvider="{acMuni}">
   <mx:columns>
    <mx:DataGridColumn headerText="municipality" dataField="city"/>
    <mx:DataGridColumn dataField="year"/>
    <mx:DataGridColumn headerText="month" dataField="month_no"/>
    <mx:DataGridColumn headerText="labor force" dataField="laborforce"/>
    <mx:DataGridColumn dataField="employed"/>
    <mx:DataGridColumn dataField="unemployed"/>
    <mx:DataGridColumn headerText="unemployment rate" dataField="unemp_rate"/>
    <mx:DataGridColumn headerText="tract" dataField="geogkey"/>
    <mx:DataGridColumn headerText="extended tract" dataField="geogkeyx"/>
   </mx:columns>
  </mx:DataGrid>
</mx:Panel>
</mx:Application>
Thanks for any help you can provide
Richard Krell

If this post answers your querstion or helps, please mark it as such.
First, use XMLListCollection for the data for the ConboBox and for the Muni result handler xlcMuni (instead of acMuni).
Here is a simplified version of your app with the answer. It uses e4x syntax for filtering.
http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_03.html
--------------- CityNames.xml ----------------
<?xml version="1.0" encoding="utf-8"?>
<CITIES>
  <city>Chicago</city>
  <city>New York</city>
  <city>Boston</city>
</CITIES>
---------- GetAllMunis.xml ------------
<?xml version="1.0" encoding="utf-8"?>
<MUNIS>
  <muni>
    <city>Chicago</city>
    <year>1866</year>
  </muni>
  <muni>
    <city>New York</city>
    <year>1872</year>
  </muni>
  <muni>
    <city>Boston</city>
    <year>1756</year>
  </muni>
</MUNIS>
------------- MainApp.mxml -------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  creationComplete="muniHS.send();cityHS.send();">
  <mx:Script>
    <![CDATA[
      import mx.events.ListEvent;
      import mx.rpc.events.*;
      import mx.controls.*;
      import mx.charts.*;
      import mx.collections.*;
      [Bindable] private var xlcMuni:XMLListCollection = new XMLListCollection;
      [Bindable] private var xlcCity:XMLListCollection = new XMLListCollection;
      [Bindable] private var xlcDG:XMLListCollection = new XMLListCollection;
      private function eHandler(e:ResultEvent):void {
        this.xlcMuni = new XMLListCollection(e.result..muni);
      private function eCityHandler(e:ResultEvent):void {
        this.xlcCity = new XMLListCollection(e.result.city);
      private function populateDG(evt:ListEvent):void{
        var temp:XMLList = xlcMuni.copy();
        xlcDG = new XMLListCollection(temp.(city == ComboBox(evt.currentTarget).selectedItem));
    ]]>
  </mx:Script>
  <mx:HTTPService id="muniHS" resultFormat="e4x"
    url="data/GetAllMunis.xml" useProxy="false"
    result="eHandler(event)"/>
  <mx:HTTPService id="cityHS" url="data/CityNames.xml"
    resultFormat="e4x" result="eCityHandler(event)"/>
  <mx:Panel width="100%" height="50%" title="DataGrid">
    <mx:ComboBox id="muniCB" dataProvider="{xlcCity}"
      prompt="Select a Municipality" labelField="city"
      change="populateDG(event)"/>
    <mx:DataGrid id="dg" width="100%" height="100%"
      dataProvider="{xlcDG}">
      <mx:columns>
        <mx:DataGridColumn headerText="municipality" dataField="city"/>
        <mx:DataGridColumn dataField="year"/>
      </mx:columns>
    </mx:DataGrid>
  </mx:Panel>
</mx:Application>

Similar Messages

  • I updated Firefox and now, when I select File, Send Link, a dialog box pops up asking me to establish a new account before I can send the link via email.

    I updated Firefox and now, when I select File, Send Link, a dialog box pops up asking me to establish a new account before I can send the link via email. I use Outlook, so how do I avoid setting up some new account and yet am able to send the link via Outlook?
    I have a feeling it may have something to do with HotMail.com.

    My Error: I found out that it was Mozilla Thunderbird that was causing the problem. I uninstalled it and the problem went away.

  • My keyboard is locked with a message that says, "carrier settings update available" but I can't select either option.....please advise

    My keyboard is locked with an update message and I can't select either option....how can I get going again?

    1. Hold the Sleep and Home button down together
    2. For about 10 seconds
    3. Until you see the Apple logo
    4. Ignore the red slider

  • Chart based on Select list with submit Lov problem

    Hi,
    I have one page with interactive report showing username with links, date and
    database actions.
    Another page contains one region having flash chart based on select list with submit Lov.
    The lov is created by dynamic query.
    Every time when i click the 1st page report link, the 2nd page lov is populating the value automatically. But the problem is chart displays NO DATA FOUND message though the LOV has many values.
    I don't want to display any null values so set to NO for LOV
    I tried to write Before header computation (PL/SQL Function Body) to set the lov value, but the query is displayed as such.
    I don't want to assign any static default value also as the values are dynamic for every link.
    The following is my Before header computation of Select list with submit (Item name is p11_schema). (PLSQL Function Body)
    begin
    if :p11_schema is null then
    return 'select distinct owner schema1, owner schema2 from auditing
    where access_date=' || :p11_access_date
    || ' and username=' || :p11_username
    || ' order by owner';
    end if;
    end;
    This is my chart query.
    select null link, obj_name label, sum(sel_count) "Select", sum(ins_count) "Insert", sum(upd_count) "Update", sum(del_count) "Delete" from auditing
    where username=:p11_username
    and access_date=:p11_access_date
    and owner=NVL(:p11_schema, OWNER)
    group by owner, obj_name
    Example: If there more than one records in the lov, the graph should display the 1st record. When i select another record, the chart accordingly display the selected values. But inially it should not display "NO DATA FOUND" message.
    I tried using all the combinations of computation type for the lov, SQL query ( I could not use if conditon then), PLSQL expression, PLSQL function body. But it does not work out.
    Can anyone please help me out.
    Thanks.

    Hi Scott,
    Thanks for your reply.
    I found out the solution for this problem as below.
    But i did it in different way to tackle the dynamic query wich returns more than one record using rownum always the 1st record when it is empty instead of assigning constant (static) value like '1'. And i am returning LOV itself for both null or not null condition as below.
    Declare
    q varchar2(4000);
    begin
    if :p11_schema is null then
    q:='select distinct owner schema from auditing';
    q:=q || ' where username=:p11_username ';
    q:=q || ' and access_date=:p11_access_date ';
    q:=q || ' and rownum<2 order by owner';
    Execute immediate q into :p11_schema USING :p11_username, :p11_access_date;
    end if;
    return :P11_SCHEMA;
    end;
    Thanks.

  • Creating a Dynamic Update Statement based on Select

    hi,
    i'm trying to create a dynamic update statement based on select statement
    my requirment is to query a joint tables and get the results then based on the results i need to copy all the data and create an update statement for each row
    for ex
    the update statement should look like this
    update iadvyy set SO_SWEEP_CNT = '1' where inst_no = '003' and memb_cust_no = 'aaaaaaaaaaaaaaaa';
    and the select statement like the following
    select substr(key_1,11,9) account_no,sord_mast SO_SWEEP_CNT from
    select acct_no,count(*) sord_mast from
    (select from_acct_no acct_no,update_mast
    from sord where FROM_SYS in ('DEP','INV') and TERM_DATE > 40460
    union all
    select to_acct_no acct_no,update_mast
    from sord where TO_SYS in ('DEP','INV') and TERM_DATE > 40460)
    group by Acct_no)
    right outer join
    invm
    on
    key_1 = '003'||acct_no
    where sord_mast > 0;
    so taking the above two columns from the above select statement and substitue the values as separate update statement.
    is that doable , please share your knowledge with me if poosible
    thanks in advanced

    is that doable , please share your knowledge with me if poosibleyes
    The standard advice when (ab)using EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the SQL before passing it to EXECUTE IMMEDIATE.
    COPY the statement & PASTE into sqlplus to validate its correctness.

  • Need update function for datagrid selected item

    Hello -- I'm using CF+ Flex+ FDS to connect and modify data.
    I am building a form that info is entered into, and then inserted
    into my database using a the wizard CFCs to insert records. That
    data is then displayed in a datagrid with the rest of the data in
    the db. When I need to update the info, I select the record from
    the datagrid and it populates my update form fields. However this
    is as far as I can get. I do not know how to write the update
    function to take the changed values of the update form and update
    the db with these values.
    I know the datagrid has an edit feature, however the field I
    need to update is not going to be a column of this datagrid. So I
    need to do it via a form where I can assign a value to the field.
    Currently i am inserting and deleting records using dataServices
    with an arrayCollection. Any help on an update function would be
    great, thanks

    Have your form elements update the associated model
    (DG.selectedItem) field. On change is often good for this, or
    focusOut. Perhaps flag the item as modified, so that you can loop
    over the dataProvider to extract the modified rows.
    Then send the modified rows to the server as an
    ArrayCollection.
    Tracy

  • Safari is not working on the Mac. Internet is fine, mail, App Store etc all working and connecting to Internet fine. Done the latest software update, still not working. When selecting a web address from bookmarks or typing in search bar, partial blue bar.

    Safari is not working on the Mac. Internet is fine. mail, App Store etc all working and connecting to Internet fine. Done the latest software update, still not working. When selecting a web address from bookmarks or typing in search bar, partial blue bar only and coloured wheel appears.

    From the Safari menu bar, select
    Safari ▹ Preferences ▹ Extensions
    Turn all extensions OFF and test. If the problem is resolved, turn extensions back ON and then disable them one or a few at a time until you find the culprit.
    If you wish, you may be able to salvage the malfunctioning extension by uninstalling and reinstalling it. That will revert its settings to the defaults.
    If extensions aren't causing the problem, see below.
    Safari 5.0.1 or later: Slow or partial webpage loading, or webpage cannot be found

  • I selected update option and it erased my ipod with all downloaded and paid materials...any ideas for how to restore?

    I selected the update option and it erased my ipod with all downloads and other materials lost...any ideas on how to restore?

    Everything should be on your computer.  Just sync it back.
    Did you fail to make sure that everything was on your computer before updating?

  • I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be

    I've been using LR with my Nikon D3200 for a year or so. Shooting in RAW/NEF no issues with import etc until I updated LR and now I can't get LR to allow me to select when I try to import. It does show the images but they're grayed out and not able to be selected. Any thoughts? TIA

    Greyed imaged in the Import dialog box mean you have already imported the photos into Lightroom, so there is no need and no benefit to importing them a second time.
    Just go to the Library module, search for the desired photos, and resume working on these photos.

  • Select point on chart and retrieve more than just data

    var ShiftChart = document.FR_Runtime_ShiftHistory.getChartObject();
    var selDate = ShiftChart.getYDataValueAt(1,ShiftChart.getLastSelectedPoint());
    alert(selDate);
    When dealing with a grid I can find the select cell value of column 1 or whatever column.  How can I do the same thing by using a chart?  In this example, I select the pen at a point on the chart and it gives me the data for it.  I would like extract other values that identify that point like Date and Line.  How can I do this?

    I used your suggestion and "nLINE" is the 2nd column.  So I replaced it with the number 2.  I did the alert and I got no data in the pop up window.  Now according to you, this means the data is not an integer.  I know that nLINE in my database is an INT.  So what could be the problem and what is the next step. 
    In my applet this is my param
    <param name="ChartSelectionEvent" value="DrillDown">
    Here is the function
    function DrillDown()
         //set up aliases for easy reference
         var ShiftChart = document.FR_Runtime_ShiftHistory.getChartObject();
         var selPoint = ShiftChart.getLastSelectedPoint();
         var test = ShiftChart.getDatalinkValue(1,selPoint,1);
         alert(test);

  • I can open a new browser window, but not a new tab, neither by clicking the plus or selecting it from the menu. I have fully updated firefox and also restarted. what's going on?

    I can open a new browser window, but not a new tab, neither by clicking the plus or selecting it from the menu. I have fully updated firefox and also restarted. what's going on?

    I have the same problem with the right click and do not have the ask toolbar installed on my system?

  • My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    Hi,
    You could use FND_FLEX_LOADER_APIS.UP_VALUE_SET_VALUE to upload them from staging table (I suppose you mean value set values...).
    You can find a sample scripts if you google around.
    What do you mean "how to map any API to our staging table" ?
    You should do at least the following mapping (which column(s) in the staging table will provide these information):
    - the 3 value sets name which you're going to update/upload (I suppose these are existing value sets or which have been already created)
    - the value set values and  description
    Try to start with something and if there is any issues the community could then help... but for the time being with the description of the problem you have provided, that's the best I can do...

  • TS4268 I can't get the iMessage or FaceTime to work on my iPod touch.  I updated to the latest iOS.  I have ensured restrictions are off and 'Set Automatically' is selected under date & time settings.  I can enter my apple ID, but it bounces back to the l

    I can't get the iMessage or FaceTime to work on my iPod touch.  I updated to the latest iOS.  I have ensured restrictions are off and 'Set Automatically' is selected under date & time settings.  I can enter my apple ID, but it bounces back to the first login screen.

    I just hit the home key very fast 3 times and it worked. Glad to see that someone suggested this to another person with a mini. My gremlins are all gone.  Yea to the forum .......Marci 73361

  • Latest update returns error " None of the selected updates could be installed. The update could not be expanded, and may have been corrupted during downloading. The update will be downloaded and checked again the next time that Software Update runs."

    Latest update returns error " None of the selected updates could be installed. The update could not be expanded, and may have been corrupted during downloading. The update will be downloaded and checked again the next time that Software Update runs."

    Which latest update? Details get answers. Rather than using SU, DL and install from http://support.apple.com/downloads/.

  • Concept insert,update,delete and select

    hi all, i want to ask
    Where I get an explanation of the concept of work process insert, update, delete and select records. From the user starts the query until accessing records the physical . or is there that can give the picture of concept process insert,update,delete and select record??

    I'm not sure what are you asking here.
    Are you asking how do I do these operations in a JDeveloper built application? Which technologies are you using?
    Have a look at this tutorial for the basics of how to do select/update - insert and delete are two more operations you can add to your page from the data control:
    http://www.oracle.com/technology/obe/obe11jdev/ps1/ria_application/developriaapplication_long.htm

Maybe you are looking for

  • Using the Admin Console

    Hello. I can't seem to get my Admin Console working ok for my new install of J2EE working. I can start the domain, get to the log on page and log in, but when i do the images are missing. I.e the folder pictures that make the left hand bar look like

  • Wfsdupld fails when run against 8.1.7 database on 64 bit Sun SPARC Solaris 8

    Attempting to run in the seed data. Platform is 64 bit Solaris v8 Database is 8.1.7.0 Workflow 2.6 Everything is fine until we run the wfsdupld script. The script fails with ORA-29516 Aurora Assertion Failed: Assertion failure at joncomp.c:127 jtc_ac

  • Upgrade database ORA-00979: not a GROUP BY expression in Oracle11g R2

    hi, I am working in Oracle 10g (10.2.0.4) Environement. I want to update Our production database from Oracle 10g to Oracle11g R2(11.2.0.3). note: OS CentOS X86-64 We follow the migration through import & Export Commands from Production database to Ne

  • Formatting series markers

    Post Author: Sriram Venkataramani CA Forum: Charts and Graphs Hi,I have a crystal report with a stacked bar chart. For one of the series in the chart I want to shown only dash(-) markers instead of showing it as a riser. So what I did was to change t

  • Services for WBS - WebDynpro Links do not work

    Hi SDN, please, can anyone help me with the links for WBS Services on the Account Assignment tab, for Projects ? I had no success on searching for this answer on the SDN. The web Links on the screen are not set up for the services. 1 - Open a Project