How to search XML data from a HTTPMultiService and display the result on the Spark List

Hello all,
I am totally new to Flash Builder and Actionscript and hope someone might be able to help me out. I basically create a mobile app with a single view. The view has a TextInput as a search box and a search button. I conntected a Data/Service using a local XML file and bind the Data to a Spark List. Innitally the List will show nothing until the user enter the search term and hit the button. The List suppose to show the XML data that match the search term.
Now is my problem. I cannot make the List to show the data that match the search text. The List just shows ALL the data.
Here are my MXML code:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:shopping="services.shopping.*"
        title="Search">
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            protected function button1_clickHandler(event:MouseEvent):void
                navigator.popView();
            protected function list_creationCompleteHandler(event:FlexEvent):void
                getDataResult.token = shopping.getData();
            protected function seach_clickHandler(event:MouseEvent):void
                getDataResult.token = shopping.getSearchData(searchTxt.text);
        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:CallResponder id="getDataResult"/>
        <shopping:Shopping id="shopping"/>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:actionContent>
        <s:Button height="79" label="Back" click="button1_clickHandler(event)"/>
    </s:actionContent>
    <s:List id="list" left="0" right="0" top="111" bottom="0"
            creationComplete="list_creationCompleteHandler(event)" labelField="english">
        <s:AsyncListView list="{getDataResult.lastResult}"/>
    </s:List>
    <s:TextInput id="searchTxt" x="80" y="34" width="250" height="49" enabled="true"
                 prompt="search..."/>
    <s:Button id="search" x="338" y="35" width="72" height="49" label="s"
              click="seach_clickHandler(event)"/>
</s:View>
Here is the _Super_Shopping.as file:
* This is a generated class and is not intended for modification.  To customize behavior
* of this service wrapper you may modify the generated sub-class of this class - Shopping.as.
package services.shopping
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.services.wrapper.HTTPServiceWrapper;
import com.adobe.serializers.xml.XMLSerializationFilter;
import mx.rpc.AbstractOperation;
import mx.rpc.AsyncToken;
import mx.rpc.http.HTTPMultiService;
import mx.rpc.http.Operation;
import valueObjects.Shop;
[ExcludeClass]
internal class _Super_Shopping extends com.adobe.fiber.services.wrapper.HTTPServiceWrapper
    private static var serializer0:XMLSerializationFilter = new XMLSerializationFilter();
    // Constructor
    public function _Super_Shopping()
        // initialize service control
        _serviceControl = new mx.rpc.http.HTTPMultiService();
         var operations:Array = new Array();
         var operation:mx.rpc.http.Operation;
         var argsArray:Array;
         operation = new mx.rpc.http.Operation(null, "getData");
         operation.url = "assets/data/shopping.xml";
         operation.method = "GET";
         operation.serializationFilter = serializer0;
         operation.properties = new Object();
         operation.properties["xPath"] = "/::shop";
         operation.resultElementType = valueObjects.Shop;
         operations.push(operation);
         operation = new mx.rpc.http.Operation(null, "getSearchData");
         operation.url = "assets/data/shopping.xml";
         operation.method = "GET";
         operation.resultFormat = "text";
         argsArray = new Array("item");
         operation.argumentNames = argsArray;
         operation.properties = new Object();
         operation.properties["xPath"] = "/::shop";
         operation.resultElementType = valueObjects.Shop;
         operations.push(operation);
         _serviceControl.operationList = operations;
         preInitializeService();
         model_internal::initialize();
    //init initialization routine here, child class to override
    protected function preInitializeService():void
      * This method is a generated wrapper used to call the 'getData' operation. It returns an mx.rpc.AsyncToken whose
      * result property will be populated with the result of the operation when the server response is received.
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
    public function getData() : mx.rpc.AsyncToken
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getData");
        var _internal_token:mx.rpc.AsyncToken = _internal_operation.send() ;
        return _internal_token;
    public function getSearchData(item:String) : mx.rpc.AsyncToken
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getSearchData");
        var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(item);
        return _internal_token;
The getSearchData() supposed to return XML data that match the search text, but it doesn't. Can anyoen help?
Thank you!

Hi,
are you able to change dynamically the  operation.url = "assets/data/shopping.xml";?
i need to do that based on the users input.
Thanks in advance,

Similar Messages

  • How to generate XML data from Lotus Notes to migrate to SharePoint by passing XML to SharePoint.?

    How to generate XML data from Lotus Notes to migrate to SharePoint by passing XML to SharePoint.?
    Ramesh S

    You could use XMLQuery to return the data from your tables as XML, that would give you a CLOB.
    An example using the SCOTT schema might be like this:
    SELECT XMLQuery(
             'for $i in ora:view("DEPT")/ROW
              return <Department dname="{$i/DNAME}">
                     <Employee>
                       {for $j in ora:view("EMP")/ROW
                        where $j/DEPTNO eq $i/DEPTNO
                        return ($j/ENAME, $j/JOB, $j/SAL)}
                     </Employee>
                     </Department>'
             RETURNING CONTENT) FROM DUAL;In the docs you can find more information about its use:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb_xquery.htm

  • HT1554 Apparently, I don't know my "com.apple.smig keychain" password. And I'm in the middle of setting up my new Mac mini. I transferred data from my MacBook and what I thought was the password isn't working! Help!!

    Apparently, I don't know my "com.apple.smig keychain" password. And I'm in the middle of setting up my new Mac mini. I transferred data from my MacBook and what I thought was the password isn't working! Help!!

    Hello,
    See if this helps...
    Mac OS X 10.4 Help, I forgot a password in my Keychain
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1960.html
    Mac OS X 10.4: Keychain Access asks for keychain "login" after changing login password...
    http://support.apple.com/kb/HT1631
    Resetting your keychain in Mac OS X...
    If Keychain First Aid finds an issue that it cannot repair, or if you do not know your keychain password, you may need to reset your keychain.
    http://support.apple.com/kb/TS1544

  • How do i erase data from start up disk to make room for the os x maverick

    how do i erase data from "the start up disk" to create room for the os x maverick

    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion/Mavericks' Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • How to retrieve time data from infotypes 2001 and 2002 when we use PNPCE

    Hello Everyone,
       I am new in using PNPCE ldb.In the requirement i have to retrieve time data from infotypes 2001 and 2002 between the begda and endda.I tried using the macro RP-READ-ALL-TIME-ITY to retrieve data.But its not supporting.Can some body help me in doing this.
    THanks in Advance..
    Regards,
    Chinni.

    Hi
       Try the following code:
    REPORT  ZHRTM41.
    nodes peras.
    Tables: PERNR.
    Infotypes: 2001.
    start-of-selection.
    get peras.
    rp_read_all_time_ity pn-begda pn-endda.
    end-of-selection.
    loop at p2001.
    write:/ p2001-abwtg,p2001-stdaz.
    endloop.
        It worked for me when using PNPCE. let me know if you have any problem
    Thanks,
    V.Nagaraju

  • Pull data from SQL Table and display it in mail

    I have a requirement to pull the data from SQL table and send it in email.  Currently I am sending the hard coded info in email but is it possible to pull some data from SQL Table and than format it and send it across in the same email? 
    Can you guide me with steps on this.
    Neil

    There are several ways to do this.  First is to populate a file in a data flow and then send that as an attachment in the send mail task. 
    As far as including the results in the email body this becomes a bit trickier.  To use a variable you would need to use an SSIS variable type of
    Object, this is similar to a collection in .NET.  The problem once the object is populated is that it isn't like a readable result set, but again more like an array or a collection.  There is no native method to take the object variable and
    specify .ToString() or cast its results as text.  You would need to iterate through each row and append it to another variable of type string, this could be done with a script task or ForEach container.
    Also you mentioned formatting the results.  What type of formatting were you looking for.  A limitation of the SMTP send mail task is that the message body doesn't support HTML so if you were looking at creating a table within the mail body you
    would have to use a script task or a custom component
    David Dye My Blog

  • We want to read data from weigh bridge and display in oracle forms & store

    Sir/Madam,
    in our organisation we had one requirement. i.e is reading data from weigh bridge using serial port, displying that data in oracle forms and when ever user click save button we store that into my oracle database. we are using oracle 8i and forms 6i and windows OS environment. we don't know reading data from serial port and placing that into form items. please help me as early as possible if there is any property available in d2k regarding this requirement .
    thank you,
    vishnu

    There's no property in Forms that makes you read serial ports, but as far as I know you need to know the API of the machine which you want to read data from (it should come with machine's manual) and then it will be easy to store it in forms item.
    Tony

  • How to Snap/Grab Image from 1394 camera and display the Image in CWIMAQVIEWER in VC++ ?

    Hi,
    I have :  -  IMAQ1394 2.0.1
                  -  NI Vision 7.1
    In VB, I can Snap/Grab Image from 1394 camera and display the Image in CWIMAQVIEWER :
        Dim Image0 As New CWIMAQImage
        imaq1394SnapCW(sid0,Image0)
        CWIMAQViewer1.Attach Image0
    Now,How can I do this in VC++6.0?
        I tried:
                  C_CWIMAQImage m_imgViewer1;
                  m_imgViewer1 = m_CWIMAQVision1.CreateCWIMAQImage();
                  m_CWIMAQViewer1.Attach(m_imgViewer1);
                  imaq1394SnapCW(Sid,m_imgViewer1);  <--there is no "imaq1394SnapCW "function in VC++,why?
        Please help me!
        Thank you!

    For people looking back at these old posts regarding
    CWIMAQViewer - it was not made to be used in the C environments and is made
    for VB.
    Refer to the following locations for displaying images in C
    environments:
    Start»All Programs»National Instruments»Vision»Documentation
    Start»All
    Programs»National Instruments»Vision»Text Based Examples
    Make
    sure that you look at the examples and documentation that is in
    reference to the C environments not the VB environments
    Vince M
    Applications Engineer

  • Help! Read raw Image data from a file and display on the JPanel or JFrame.

    PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

    Hey,
    I need to do the same thing. Did you find a way to do that?
    Could you sent me the code?
    It's urgent, please.
    My e-mail is [email protected]

  • Is there any way to improve Query which searches XML data from a table??

    hi all,
    i have a table which have one column say 'colA' as Varchar(max) datatype which  i  save xml data and it have other cols too 
    Currently i am searching data inside this table using like operator
    eg:
    Select * from tablename where colA like ‘%<tagname>parameterstringvalue</tagname>%’
    when i check with the Execution plan i could see it Takes 82% for clusterd index scan ( primarykey col
    not ColA)
    i added new non clusterd index for the same with include col as ColA and i found nonclusterd index scan
    with same estimated I O cost and Extimated operator cost as clusterd index scan
    My Question is :-
    1. why didnt nonclusterd index seek come?
    2. In What way i can improve perfomance for such situvation? i had seen couple of post suggesting to rewrite the Query as SELECT
    * FROM myTable WHERE CONTAINS (myCol1, myCol2, "myString").
    I Try creating Full text index and found cost increased compared to the original Query ?
    3. As per my assumption the wild charecter ('%') in begining makes perfomance issue is there any option
    or an alternative for such case?

    hi...i can give a skeleton 
    --Table Structure------------
    Table1:-
    (colA - int(PK),
    ColB - Varchar(max),
    ColC-uniquieidentifier,
    ColD-datetime,
    ColE-Bit)
    It have clusterd index for ColA
    Table2:-
    (ColA-int(fk)
    colF-int(pk)
    colG-varchar(max),
    ColH-uniqueidentifier,
    colI-int,
    colJ-int
    ColK-date)
    -----------------Query Skeleton-------------------: 
    select Distinct
    s.colA,
    s.ColB,
    S.colC,
    S.colD
    from Table1 s with (nolock)
    left outer join table2 Q with (nolock) on s.colA=q.ColA
    where Q.ColA is null
    and s.colB like '%<tag>sometext</tag>%'
    and s.colD >='1/1/2010'
    and s.colD <='1/1/2014'
    i hope this will help to understand it clearly.........

  • How to read XML data from URL

    Hi All,
    I have one requirement. I have one URL which gives me data in XML format. I need to read this file and store this data into my SAP tables.
    Can anybody suggest how read this XML file using URL?
    Thanks in advance,
    P.Shridhar.

    Use a Server java proxy generated from your inbound message interface which would make a URLConnection to the specified URL after it gets triggered by BPM. A code snippet to achieve the same could be
    URL url  = null;
    URLConnection conn = null;
    BufferedReader in = null;
    url = new URL("http://someurl.someserver.com");
    conn = url.openConnection();
    in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line = null;
    StringBuffer xml = new StringBuffer();
    while ((line = in.readLine()) != null){
            xml.append(line);
    -- amol

  • How to read xml data from jsf,

    Hi
    I would like to know how to read data in an xml so as we can display that data onto the jsf page to the user, say as a data table, or in an output txt box etc...

    This is nothing JSF-special. Just convert XML to objects (DTO's) and then use them in JSF.
    There are several ways to crawl the XML tree. JXPath and DOM4J are popular.

  • How to retrieve all data from iPod Touch and copy to new computer?

    I recently purchased a new iPod and MacBook. The MacBook was stolen and I had to buy a new one. I have a lot of music and photos on the iPod I would like to recover and copy back to the MacBook. However, the iTunes says it will delete everything. I want it to sync everything from the iPod and continue with that data.
    How can I do this?
    Thanks,
    gonzobrains

    You're welcome, child.
    "backups. But that's not my point. I find it disappointing that I cannot sync my data both ways."
    O.K. It still is the way it is.
    "Here I have gigabytes of data sitting right here on my iPod and no way to natively copy it back to my new computer without purchasing third-party software."
    Yes, this is true.
    "Every other mobile device I have ever owned let's you easily copy back to a computer. Just plug it in, mount it, and there you go."
    As you now know, this is not the case with the ipod touch.
    You asked how and I told you that you cannot without 3rd party software. What is it that you want?
    Simply maintaining a backup (basic) would solve the issue.

  • How do I retrieve all data from a table and display it on a text area?

    I want to retrieve all the data from one of my MS Access data table and display them all in a text area. how do i go among doing this?
    In my car table i have the fields lined up like this..
    license,color,doors and year_made
    I have an Object class called CAR that will contain methods to set the data from these fields when it gets retrieved.
    here's what i go so far.....
    statement = getDBConnection().createStatement();
         rs = statement.executeQuery("select * from car");
         boolean moreRS = rs.next();
    if(moreRS)
    car.setLicense(rs.getLong(1));
         car.setColor(rs.getString(2));
         car.setDoors(rs.getString(3));
    car.setYearMade(rs.getString(4));
    //but this will only get me one car. How do I get more car data?
    HELP!!

    Vector cars = new Vector();
    while (rs.next()) {
      String license = rs.getLong(1);
      String color = rs.getLong(2);
      String doors = rs.getLong(3);
      String year = rs.getLong(4);
      myTextArea.append(license+"\t"+color+"\t"+doors+"\t"+year+"\n");
      Car car = new Car();
      car.setLicense(license);
      car.setColor(color);
      car.setDoors(doors);
      car.setYearMade(year);
      cars.add(car);
    }t=tab
    n=newline
    Vector: http://java.sun.com/j2se/1.4.1/docs/api/java/util/Vector.html

  • How do I transfer data from old hard drive to new mac exactly the same as it was on my old one?

    Unfortunately my 2009 iMac has been written off due to a faulty motherboard. Thankfully the company we got the mac from are providing me with a brand new one at no cost as I am under warranty. My old hard drive had many important documents and applications on it and we have requested for the old hard drive back. What I would like to know is how to I go about transferring all the stuff of my old hard drive to my new iMac? I would like everything to be set out exactly the same as it was on my old mac so basically I would like it cloned identical on my new mac from my old hard drive.
    Thanks Nathan

    In general, most people will recommend Carbon Copy Cloner or SuperDuper! You can find either one easily enough with a web search.
    However, in your case, I imagine you are going to have a hard disk returned to you all by itself, and you will need to install it in an enclosure. Don't let that bother you as this is easy to do and the enclosures are not expensive ($40 or so).
    Once that is done, I would recommend you set up your brand new Mac by answering all the questions during initial setup as usual. Be sure to use your correct Apple ID - probably the same one you used to log into this support forum. When you reach the point in which it asks you if you would like to transfer your old documents and settings, connect the old hard disk and select it as the source. It will take some time as it copies all its contents to your new Mac. All your familiar items will be exactly as they were on the failed Mac.
    After that, you can use the old hard disk as a Time Machine backup. When you are satisfied everything on your new Mac is running as it should, go ahead and erase the old disk. Then, tell Time Machine to designate it as a backup, and the rest is automatic.

Maybe you are looking for

  • I need to get a list of sites I've visited from my home desktop computer while in private browser mode. I need all sites from 2011 & 2012

    I need to get records of websites I visited for 2011 & 2012 while private browsing on Mozilla firefox. The info page said although this info would not be recorded onto my computer there would be records of these websites through the Internet provider

  • FICO Impact for Subcontracting process

    Hi Experts, can u please explain the impact of Subcontracting Process (specialy in GR/IR) On the FICO area, with transaction keys (FRL ....) involved. thank u very mutch. NB: If u have a doc on this please send on [email protected] Thanx In advance.

  • Any facility in Cocoa for word completion?

    I'm looking for some interface to the Mac OS dictionary, with the goal of being able to get a list of words which match a basic expression. For example: asking for words that are 5 characters long that match the form sh_. Feature useful for suggestin

  • Chart DateTimeAxis Duplicate Time

    Do you know if there is a way to handle duplicates in a DateTimeAxis? For example, if my dataset is Time, Quantity 12:00:01pm, 1000 12:00:02pm, 500 12:00:02pm, 500 The chart only shows Quantity = 500 at time 12:00:02pm. Is there an automatic way to a

  • How do I remove loading pages in between my video slides?

    Hello, I have a 10 slide project in Captivate 8 where each slide is a separate video. When I publish the project, a loading circle appears before each new slide which is very distracting. Are there any settings I can change to stop this from happenin