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>

Similar Messages

  • 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.

  • 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

  • How can I do for a row of a query be data provider for a variable?

    Hi friends, I have a problem !
    How can I do for a row of a query be data provider for a variable?
    I need that a value of variable be stored when the user select a row in a query. At the BPS we can do this configuring the variable selector in WIB, and in a WAB how I can do this ?
    Best regards,
    Gustavo Liberado

    In this case when I press the key to call other forms I need to wait for the response in the secondary form and then process the result.That is exactly what a "modal JDialog" (or JOptionPane) are used for.
    Try it. Create a short demo program. All you need is a JFrame with a single button to show the modal dialog. All you modal dialog needs is a single button to close the dialog. After you show the modal dialog add a System.out.println(...) statement in your code and you will see that it is not executed until the dialog is closed.
    Then once you understand the basics you add the code to your real program.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • So can I use our local internet provider for the e-mail account, or do I have to use Apple?

    So can I use our local internet provider for the e-mail account, or do I have to use Apple?

    Yes, you can use the Mail app on the iPod for your internet mail provider.  Go to your provider's mail support website to find out how to set up the account on the iPod.  They probably will not have instructions for an iPod but the one for the iPhone should do.

  • Using a Web Service as a data provider for a Crystal Report

    <p>I&#39;m trying to write a Crystal Reports XI report that uses a Web Service as the data provider.  I have a Web Service written in ColdFusion that looks like this.<br /><br /><cfcomponent displayName="FindEmployee" ><br />   <cffunction name="FindEmployeeSort" access="remote"          <br />               returnType="xml" output="false"><br />      <cfdump var=form><br />      <cfset myXML = ""><br />       <!--- FindEmployeeSort body ---><br />       <cfquery name="EmployeeQuery" datasource="Production"><br />           Select * from employee<br />          <cfif isdefined(&#39;form.lastname&#39;)><br />             WHERE lastname LIKE &#39;%#form.lastname#%&#39; <br />          </cfif><br />           Order by lastname asc <br />        </cfquery><br />     <cfreturn EmployeeQuery>  <br />   </cffunction><br /></cfcomponent><br /><br />I can get the web service to work from a ColdFusion page (either locally or on a remote server).</p><p>When I try to create the CR data source, I get the following error:</p><p>Crystal Reports<br />! Logon Failed.<br />Details: Cannot find correspondign table information in the XML file</p><p>The steps I took were:<br />* Choose XML from the "Avalable Data Sources"<br />* Choose "Use Web Service Data Source"<br />* Choose "Use HTTP(S) WSDL" with a url of <a href="http://host/directory/FindEmployee.cfc?wsdl">http://host/directory/FindEmployee.cfc?wsdl</a><br />* Leave the "HTTP(S) Web Service User ID:" and "HTTP(S) Web Service Password:" parameters blank<br />* Accept the defaults for Services, Ports, and Methods.  They are respectively FindEmployee, FindEmployee.cfc and FindEmployeeSort.<br />* Then get the error</p><p>The most likely candidate to me is the user id and password, but I have no idea what to use.  I didn&#39;t have to set any login information up in the ColdFusion pages that I used to test the Web Service.</p><p>Any ideas where to go from here?</p><p>Thanks,</p><p>Brian</p>

    Please re-post if this is still an issue to the Java Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • Oracle Data Provider for Oracle 10g

    We have an application certified on the ODP 9.2.0.2102, Oracle Client and Oracle ODBC 9.2.0.6. We have a client who is moving to Oracle 10g client within the next few months but will still be hitting an Oracle 9.2 backend.
    My question is: Is the 9.2.0.2102 ODP compatible with the 10g client, or do we need to certify against a newer version of the ODP? And if the latter, what version of ODP is recommended?
    We plan to certify against the latest of both this year, but for now, we need the path of least resistence.
    Thanks for your help.
    Todd

    It is not "hard" to create your own geocoding schema though you will need to know how to create tables (with Oracle Spatial columns) in Oracle and before you do create the tables you should read through the documentation to be certain you have all of the required data and metadata.
    Navteq, a data provider, also has sample geocoding data (http://www.oracle.com/technology/products/spatial/htdocs/spatial_partners_data.html) as well as data for sale. Downloading and importing the Navteq data might give you a good idea about what you will need to do if you were to build your own geocoding schema using your data.
    I hope this helps.
    -Justin

  • Bank row was added in webi rich client when using excel as data provider

    reproduding steps:
    1.open webi rich client.
    2.Create a new webi report,then select "local data source"
    3.select an excel file as data source.
    4.run query.
    For example,there are 5rows in excel,but in webi report there are 6 rows,and the last row is bank which is added by webi.
    question
    1. mcro has been defined in the excel file,is there any impact by using macro?
    2.I want to know why this happens,

    >could you please test the following solution if you have multiple data providers in the report.
    >We need to manually link the dimensions then in the resulting crosstab/table we are need to apply >filters and select only the values but not the #empty values.
    I have only one data provider in the report.
    And, I have do the following test,
    test1:Delete the last row which is blank row of the excel file,refresh webi report, the last blank row is still there.
    test2: press ALT+F8,delete marco in the excel file,refresh webi report, the last blank row is still there,then delete the last blank row in the excel file ,save excel file,refresh webi,the last blank row is disappear.

  • Need help coneverting data provider for inline fx:Component renderer for a datagrid

    I want to use an existing inline item renderer and point the hard coded data provider to an arraycollection, which comes from a database.
    At firt glance this looks easy, just change
    <fx:Declarations>
      <fx:Component id="inlineEditor">
       <mx:ComboBox >
        <mx:dataProvider>
         <fx:String></fx:String>
         <fx:String>AIG</fx:String>
         <fx:String>BHN</fx:String>
         <fx:String>FH</fx:String>
         <fx:String>LM</fx:String>
         <fx:String>SD</fx:String>
        </mx:dataProvider>
       </mx:ComboBox>
      </fx:Component>
    </fx:Declarations>
    TO
    <fx:Declarations>
      <fx:Component id="inlineEditor">
       <mx:ComboBox
        dataProvider="{outerDocument.wripAttachTypeAc}"
        labelField="WRIP_ATTACHED_FILE_TYPE_DESC">
       </mx:ComboBox>
      </fx:Component>
    </fx:Declarations>
    BUT that does not work the data grid produces the object.object value as theres no association to the labelField . Can anyone see what I am doing wrong. The datagrid entry is
    <mx:DataGridColumn dataField="Permit File"
              width="150"
              editorDataField="selectedItem"
              itemEditor="{inlineEditor}"/>

    Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
    I'll update this thread if I manage to do it.

  • Error Calling Data Provider for Return PO in Me21N Message Number FES011

    Hi Experts,
    I am trying to create a Return PO using ME21N. Im giving all the parameters and values. But While saving its generating an Error.
    it states "Error calling Data Provider".
    Message No. FES011
    What could be the possible error . Any clues?
    Thanks and Regards,
    Selvakumar. M

    hi,
    Check with the Basis consultant....actually Data provider deals with the database..Also sometimes when the data provider doesnot provides the data...the error doesn't reach....
    Pls check with the BASIS consultant....the netweaver part could be checked by ABAP consultant...
    Also check the links:
    http://msdn.microsoft.com/en-us/library/bb508810(SQL.90).aspx
    http://help.sap.com/saphelp_nwpi71/helpdata/en/11/e8179b247e4720882512a04041491d/frameset.htm
    http://sapnetweavernotes.blogspot.com/2008/04/sap-earlywatch-alert.html
    Hope it helps....
    Regards
    Priyanka.P

  • Stored Procedure used as a data source for an Apex report

    Just wondering whether anyone has used a Stored Procedure as the data source for an Apex report. An option to select Stored Procedures(s) as the data source does not appear within the IDE (only displays Table, Views, Functions).
    Do you have to return the definition of the Stored Procedure via a function ... if so, how is this done ?
    Thank you.

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "920338".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    Just wondering whether anyone has used a Stored Procedure as the data source for an Apex report. An option to select Stored Procedures(s) as the data source does not appear within the IDE (only displays Table, Views, Functions).
    Do you have to return the definition of the Stored Procedure via a function ... if so, how is this done ? When asking a question about "reports" it's firstly essential to differentiate between standard and interactive reports. Standard reports can be based on tables, views, SQL queries, or PL/SQL function blocks that return the text of a SQL query. Interactive reports can only be based on a SQL query.
    "Stored Procedures" are therefore not an option (unless you are using the term loosely to describe any PL/SQL program unit located in the database, thus including functions). What would a procedure used as the source of a report actually do? Hypothetically, by what mechanisms would the procedure (a) capture/select/generate data; and (b) make this data available for use in an APEX report? Why do you want to base a report on a procedure?

  • Use XML as data input for Crystal Report for Eclipse

    Hi,
    I am completely new to crystal report and please kindly forgive me if I ask some stupid questions.
    Actually, I have searched the forum for the topic and found some related threads, but I still want to
    have some responses from crystal report experts on this issue.
    Our developer tool is IBM RAD 7.0 and it has crystal reports tools installed in it. I want to use
    crystal report to solve one of our business solutions. I have the following questions about the
    feasbility of this solution:
    (1). I need to specify data at runtime during report generation. I think using fixed data source
         (for example, SQL query or Stored Procedure) may not fit our needs. I think if crystal report
         can accept XML as input to generate reports at runtime, then it will be perfect. Can CR
         use XML as data source as input?
    (2). Actually, one of our business requirements is to generate a letter. Can CR do a report
          layout such that a letter format can be achieved? If yes, would you let me know the
          report layout name?
    (3). We need to export the report into PDF format, I know CR can do PDF output. But can
          CR be controlled to export this into bytes stream? Or the PDF must be saved into a
          physical file?
    (4) If I need to learn more about CR, which book will you recommend?
    Thanks in advance for your advice,
    Raymond

    Thanks for the help Ted
    Works like a charm now.
    Or atleast my very very simple XML report works.
    Now I just need to play around and see what I can do and what I cant.
    I just want to make sure I understand how this works.
    1) I start of with a XML file (or URL or other data source as explained in your BLOG)
    2) I then have to create blank report which will have its data source set to my XML file.
        This report (rpt file) will always have its data source set to the original XML location
    Can this be dynamically changed, or does a new rpt file need to be created each time
        (or atleast I will have to re-run "CreateXMLInlineSchemaReport" from your BLOG)
    3) I can now use this rpt file as I would any other rpt file but its data source will be the original XML file
       - If I update or change the XML file, the report will dynamically reflect these changes.
    4) To change the data source, I need to recreate a new rpt file as per point 2. Which will now be blank.
    5) Filtering.... if I want to filter the XML data do I use normal parameters. If I want to filter the data before
        I pull it do I need to change anything. In otherwords if I have a XML file with 1000 records, but I only want say
    5 of them, how do I only pull those 5 without first pulling the whole 1000 records. Hope that makes sense.
    As I said I am very new to this so some things still fly over my head, but I do play around abit so hopefully
    will find what I am looking for.
    Cheers
    Darren
    PS any other links to info on creating and running reports of XML data sources would be greatly appriciated

  • Using InfoSets as Data Source for segmentation

    Hi Experts,
    I'd like to use my own InfoSet as Data Source for segmentation.
    The goal is, for example:
    Select all BPs who have Leads (Just simple one to describe my question).
    So I've created new InfoSet which joined tables:
      CRMD_ORDERADM_H
      CRMD_LINK
      CRMD_PARTNER.
    The question is how should I restrict the InfoSet to use only object type "CRM Lead" (CRMD_ORDERADM_H = 'BUS2000108') and partner function "Activity partner" (CRMD_PARTNER-PARTNER_FCT = '00000009')?
    I've managed to do this by small addtitional coding in Record Processing in the InfoSet as:
    CHECK crnd_orderadm_h-object_type EQ 'BUS2000108'
      AND crmd_partner-partner_fct EQ '00000009'.
    But it seems that it's not the best way (and no the best practise's one) because all records from the joining are processed and for each of the record this conditions are checked.
    It'd be better, I think, to put this conditions as selection options. But it doesn't work (or I didn't do it properly). What I've done is: I've made them as selection criterions in my InfoSet and put default values for them. But segment builder didn't use them (default values) as I can see.
    Appreciated for your any advices.

    Hi Monica,
         Ofcourse query will be written by BW consultants but the requirement should be passed on by Business. CRM Functional Consultant responsibility is to understand the Business requirement and should guide BW consultants. Also make sure that BW system is in the CRM landscape for such requirement.
    regards
    KK

  • Using Infoprovider as data provider in BExGetdata

    Hi Folks,
    I am trying to use, Infoprovider (a multi-provider) as data provider in one of query which uses BExGetData function module to retrieve data from BI. However I am getting #NV everywhere in data.. (#NV means query is not able to recognize data provider).
    If I change dataprovider to query, data looks fine. Any idea what is issue with Info-provider?
    Thanks,
    -RS

    One more question with BExGetData...
    when I create query and have 2 key figure... change to set to formula mode. It looks ok, but if I want to include more key figure it is again giving #NV (data provider still remains - query).

  • 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

Maybe you are looking for

  • Query Timeout on stored procedure executed from Access 2010

    I am trying to delete old jobs from a SQL 2008 R2 database. I created a stored procedure on the server that deletes all Jobs over 1 year old. The delete can take several minutes to run as it deletes record on several related tables. I am getting a er

  • Unable to find XML document from class path resource

    Hi, I am trying to learn spring and wrote my first class today. I added all the jar files to the lib folder and created all the classes. When I try to run the client program I get [INFO] XmlBeanDefinitionReader - Loading XML bean definitions from cla

  • Things to consider while Creating Indexes in the tables

    Hi All, We have some application slow issues becasue of the tables which it is calling are Heap. There are Primary keys created on few tables though. I have to think and design the indexing on those tables. What are different things need to check to

  • Unable to open excel files from yahoo mail

    I am unable to open an excel file in Yahoo! Mail (sent from PC) to my iMac.  My iMac has the MS Office suite too.  Any suggestions?

  • Forte4j

    HI! I have a WEB Module developed with Forte 4J. Does anyone has any idea on how to convert it to JDeveloper? I4ve tried a lot of things, but I couldn4t do it. It seems JDeveloper can4t detect my sources, only the html/jsp files. Any ideas?