HTTPService result

Hi friends,

I have a HTTPService I'm having the problem, try to use the returned data. I have a ColdFusion component that returns data in XML format.

When I use dataProvider = "{objService.lastResult.projdata.datarows}" it works very well and the line chart shows data. "

But, when I try to use the data returned in the 'Result' event with an event handler, the table is empty. Can someone tell me what could go wrong? My code in the result handler looks like this

< mx:ArrayCollection id = source = "{ArrayUtil.toArray (event.result.projdata.datarows)"acProjData"}" / >

The variable 'acProjData' has already been declared as a variable bindable by using

[Bindable]

private var acProjData:ArrayCollection;

I'm not very familiar with programming Flex 4.5. I'm just trying to learn and hope to get my prototype work. Thank you.

-Milind Joshi

Answering my own question:

I changed the line

for this

acProjData = event.result.projdata.datarows as ArrayCollection collection;

My table now displays the data.

-Milind

Tags: Flex

Similar Questions

  • How can I insert a HTTPService result in a SkinnableDataContainer

    Hello

    How can I can put a HTTPService result that looks like this:

    <user>
         <username>user</username>
         <email>[email protected]</username>
    </user>
    <user>
         <usernam... and so on
    

    in a SkinnableDataContainer or an ArrayList?

        <s:SkinnableDataContainer dataProvider="{UserArraylist}" itemRenderer="Skins.UserItemRenderer" >
            <s:layout>
                <s:VerticalLayout gap="1" />
            </s:layout>
        </s:SkinnableDataContainer>
    

    I tried loop content that is part of the result and put it in an ArrayList, but failed.

    Thank you

    Zombiecook

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" creationComplete = minHeight "application1_creationCompleteHandler (event)" > "

    Import mx.collections.ArrayCollection;

    Import mx.collections.ArrayList;

    Import mx.collections.IList;

    Import mx.events.FlexEvent;

    Import mx.rpc.events.ResultEvent;

    [Bindable] private var myArrayList:ArrayList = new ArrayList();

    protected function myService_resultHandler(event:ResultEvent):void

    {

    TODO self-generating method stub

    myArrayList.addAll (IList (event.result.catalog.book))

    }

    protected function application1_creationCompleteHandler(event:FlexEvent):void

    {

    TODO self-generating method stub

    myService.send)

    }

    ]]>

  • How to get to the HTTPService result in a function?

    Hi all

    I'm currently calling send() to a HTTPService and get the resulting data in a function and assigning locally. Specifically, this is what I want:

    private void getData (): void {}
    myRPC.send ();
    How to set the myRPC.send to a variable result, here?
    MyRPC.send (property or myRPC.lastResult) works! I get null to everytime!
    But if I set myRPC.result to a separate function that handles an event, I get the correct data... but not what I want.
    var myObject:Object =? myRPC. ???
    }

    < mx:HTTPService result = ""? "= fault"? "id ="myRPC"method ="GET"resultFormat ="e4x"url = 'someurl" useProxy = "false" >
    < mx:request xmlns = "" >
    < somedata > Hello < / somedata >
    < / mx:request >
    < / mx:HTTPService >

    I'm also not what to put in 'Result' and the 'fault' because I don't want the result/fault to move on to another function... anyone would explain this please? Thank you!

    HTTPService is asynchronous, you can't get its value in a function. But you can call it another function of the HTTPService resultHandler and pass this function the data. I know you want to use this feature to 'send' the HTTPService, but even in this case you could split into two functions to call send() and the other which is called the resultHandler. Just a thought... :-)

  • HTTPService results

    Greetings!

    I make a HTTPService call to retrieve the XML that is bound to a datagrid control. When parameters passed to the service result in no return XML, I would like to be able to display an alert instead of having just sitting empty datagrid, but cannot figure out how to do. Been trying result = "onResult (event)" in my HTTPSService, but don't know what should be the onResult function. "

    Any help is greatly appreciated!

    In addition:
    private void onResult(event:ResultEvent):void {}
    var xmlResult:XML = XML (event.result);
    trace (xmlResult.ToXmlString ());
    probably, xmlResult.toXMLString () will return an empty string may be null. Test for those.

    Tracy

  • need help with dataProvider and HTTPService result

    Hello

    I am following the tutorial from flickr http://labs.adobe.com/technologies/flexbuilder2/tutorials/# and a stumbling wrt the HTTPService. The example HTTPService has id = "service" and the "Search" button called "service.send ().
    The TileList is used to display the data and the dataProvider = "{service.result.rsp.photos.photo}". "

    In the example, the AutoComplete even showed that service responded to the result message, but
    This isn't the case for me. AutoComplete for me only shows 'resultFormat' as a possibility. Using
    result, I get the error:

    The result of the property possibly access not defined through a reference with static type mx.rpc.http.mxml:HTTPService. flickr1 flickr1.mxml line 11

    Am I missing something?

    Thank you

    Try 'lastResult' instead of result.

  • HTTPService result Formats

    Hello

    I'm working on HTTPSerivce. I want to know what are the result formats in httpserivce.

    Thank you

    Kiran

    To after my book: object, array, xml, flashvars, text, e4x.

  • Frameset HTTPService result?

    Flex seems to be wrapping my XML in a frameset when I invoke the method 'send()' of my HTTPService, and it's screwing up the response analysis. (I get runtime error ' Error 1090: XML Parser Error... ") ("dreaded). It is not made by my server, because if I just surf this URL in a browser, I get what I expect: pure XML.

    Anyone know what is happening?

    Thank you
    -db

    This has proved to be a problem of cross-domain security. I was using an alias in my "url" property When I used the real domain name, he began to work.

  • HTTPSERVICE - text files

    Y at - it anyway to get Flex to retrieve a text file that looks like this:

    Table = 23 ~ 50 ~-33 ~-50 ~ 23 ~ ~ closer independent = ~ ip = 63.230.216.19

    Table 11 = ~ 40 ~-36 ~-50 ~ 53 ~ ~ narrower Republican = ~ ip = 41.200.216.19

    Table = 23 ~ 50 ~-23 ~--34 ~ 38 ~ ~ closer democratic = ~ ip = 69.20.216.19

    I essentially want to draw a line, divide it into a table named after the "narrow" SO

    It would be independent of the table is 23, 50, 33, -50, 23 when I'm done.

    I'm sorry, I know it's a lot, but the greatest achievement that I need is to be able to draw a line in the data file and split it into two channels of each.

    Thank you if someone has an idea.

    Josh

    Try this (warning, I have not tested)

    private void procResult(event:ResultEvent):Array {}

    guess httpService result is a text, not e4x, XML, etc.

    var temp1:Array = event.result.split ("= array");

    "" should now have temp1 [0] = ","

    Temp1 [1] = "" 23 ~ 50 ~-33 ~-50 ~ 23 ~ ~ closer independent = ~ ip = 63.230.216.19 ""

    Temp1 [2] = "' 11 ~ 40 ~-36 ~-50 ~ 53 ~ ~ narrower Republican = ~ ip = 41.200.216.19" "

    Temp1 [3] = "" 23 ~ 50 ~-23 ~--34 ~ 38 ~ ~ closer democratic = ~ ip = 69.20.216.19 ""

    var tempindex:int;

    var temp2:Array;

    var temp3:Array;

    var tempkey:String;

    var dataarray:Array;

    for (tempindex = 1; tempindex ++; tempindex)< (temp1.length+1)="" )="">

    Temp2 is temp1 [tempindex] .split ("off-color =");.

    Temp3 = temp2 [1].split("~");

    tempKey = temp3 [0];

    Temp3 = temp2 [0].split("~");

    dataArray [tempkey] = temp3;

    }

    return dataarray.

    }

    should result in:

    ['independent'] dataArray = [23, 50, 33, -50, 23, ' "];

    ["Republican"] dataArray = [11 40-36, 50, 53, ""];

    etc.

  • Add the HTTPService call event listener

    Hi, I use a HTTP service in my flex application.
    My HTTPServeice connects to an XML file:


    < mx:HTTPService
    ID = 'myResults '.
    ' URL =' http://localhost/myResults.xml '
    resultFormat = "e4x".
    result = "resultHandler (Event)" / > "

    the data in the XML file are constantly changing (the structure remains the same, but changing the actual data in the structure of the XML), so I am refreshing my HTTPService results every 5 seconds:

    [Bindable]
    public var myDataFeed:XML;

    private function initApp (): void
    {
    var timedProcess:uint = setInterval (refreshResults, 5000);
    }

    private function refreshResults (): void
    {
    myResults.send ();
    }

    private void resultHandler(event:ResultEvent):void
    {
    myDataFeed = event.result as XML;
    }


    My problem is that sometimes the XML file needs more than 5 seconds to load / refresh the data (as it is quite heavy) etc... that is why I want to implement some sort of event on the HTTPService listener to notify the application when the results have been refreshed so I can limit / 5 seconds refresh taking place until the previos refresh is complete etc...

    is it possible - to an event listener for an HTTPService to know when it has finished refreshing results to an XML file?

    Thank you
    Jon.

    Instead of having a timer object runs the service every 5 seconds let the service itself run itself once the result is successful.

    Both in the
    private void resultHandler(event:ResultEvent):void {}
    myDataFeed = event.result as XML;

    couple options-
    1. call the service again... maybe build a kind of late here.
    2. run another object that has a delay, then runs the service
    I work late here because put the send here will keep your communications with your server constantly active.
    myResults.send ();
    }

    All you need to do is run this service on the initialization of the application and will continue to call itself.

    However, I think you may have a fundamental problem with two approaches that your communication with the server is constant. If you need to make other calls to the server, for example to save data or fill out another form, you need to manage your connections.

  • Bind a value to a HTTPService to a variable

    Hi, I'm looking to bind a value to a HTTPService to a string variable. Here my HTTPService:

    "" < mx:HTTPService id = "GetVin" url = " http://127.0.0.1/vin.php" resultFormat = "e4x" useProxy = "false" result = "BindData (); "/ >

    [Bindable]
    private var description_var:String;

    private void BindData (): void {}
    description_var = GetVin.lastResult.vinlist.vin.description;
    }

    And my HTTPService result:

    <? XML version = "1.0" encoding = "ISO-8859-1? >
    < vinlist >
    < id wine = '1' description = 'test' > < / wine >
    < / vinlist >

    I can't find the way to have everything simply: description_var = 'test '.

    Thanks for your help!
    Mika

    Maybe try to change the XML to something like:



    1
    test

    HTH

  • Need help with analysis on XML DataGrid

    Hello

    I retrivied in my function from HttpService result data.


    < list >
    < user >
    < ename > JAMES < / ename >
    < > 7900 empno < / empno >
    < / user >
    < user >
    < ename > FORD < / ename >
    < > 7902 empno < / empno >
    < / user >
    < user >
    < ename > MILLER < / ename >
    < > 7934 empno < / empno >
    < / user >
    < / list >

    [Bindable]
    private var xmldata:XML;

    private void resultHandler(event:ResultEvent):void {}
    XMLDATA = Event.Result as XML;
    }


    < mx:DataGrid x = "50" y = "23" width = "469" height = "265" dataProvider = "{xmldata." The user} ">"
    < mx:columns >
    < mx:DataGridColumn headerText = "Type" dataField = "ename" / >
    < mx:DataGridColumn headerText = "Sales" dataField = "empno" / >
    < / mx:columns >
    < / mx:DataGrid >

    But this displays all the data in the DataGrid control.

    Could someone help me please.

    Thank you.

    After obtaining data affect data in the data grid

    DataGrid.DataProvider = xml;

    and also do datagrid.invalidateList () after u get the data if the line above does not help

    See also if the data provider is not null, if nothing is done.

  • selection of data provider

    Evening

    I'm trying to create a selection of provider data drop-down menu. The box should allow the selection of one of the many external XML documents, which, once selected, fills the grid of data below.

    So far, I got the XML documents set up and have been able to connect with the main project

    I've got datagrid works well with the sizes and the behaviors and displaying data correctly

    I have a drop down (heheh) working

    This is the part where the drop-down list displays a list of XML documents and allows me to select as the data provider for the datagrid control that left me speechless.

    I wonder if anyone would be good enough to point me in the direction of a tutorial, or example of code that would allow me to do. I had to go, but can't think of any other term to use in addition to the obvious (XML, supplier data, selector provider data, selection of provider data etc.).

    I also wonder if I'm looking for, but perhaps more complicated I think, which may be the reason why I have not stumbled on something specific still.

    All the best,

    Mag

    PS I'm new too, which I think can be evident by the issue Flex looks too useful to let learning, so it's time to take the plunge, according to me.

    Hello

    HTTPService to load xml files at runtime and set the dataprovider in the the HttpService result handler. After xml loading, save an array or a dictionary for the second time that the same item is selected, you can load it from the table.

  • Auto refreshing Tree control

    Hello

    I need to reload the tree control every 1 minute.

    Reloading is done using the HttpService result

    Can someone give me a sample code for auto-refresh?

    Timer installation code might look like this (in an init() function):

       import flash.utils.Timer;   import flash.events.TimerEvent;
    
       // create a timer which fires every minute (60 * 1000 ms)   var timer:Timer = new Timer( 60*1000 );
    
       // add a listener to the timer   timer.addEventListener( TimerEvent.TIMER, refreshTree );
    
       // start the timer   timer.start();
    

    Then your method refreshTree() could hit the service to get the new XML.

    Let me know if that helps...

    Ben Edwards

  • Binding XML to ArrayCollection collection

    I'm completely stumped. I had an application that worked in Flex Builder 2 beta 3 that brought them a HTTPService and linked to an ArrayCollection collection XML results. Then I could use the ArrayCollection collection as my dataProvider for a DataGrid control. This method allowed me to do a prior sorting the data by sorting the ArrayCollection collection. I've recently upgraded to the latest version of Flex Builder 2 and now it seems that the application does not work. It says I have to go the HTTPService results in table form:

    < mx:ArrayCollection id = source = "{ArrayUtil.toArray (service.lastResult.resultset.result)"myAC"}" / > "

    When I do this, the application is built, but now the DataGrid control is not complete. I tried everything I could think of getting this work. Can anyone show me an example where the XML returned by a HTTPService is bound to a collection that is then bound to a DataGrid control?

    I thought about it. I have no idea why, but I had to make the connection as:

    [Bindable]
    private var xml:ArrayCollection = null;

    private void bind(event:ResultEvent):void {}
    XML = event.result.resultset.result;
    }

    Then for the HTTPService:

    http://localhost"/ >

    Now everything works fine. I can sort, filter, etc. on the ArrayCollection collection.

  • Query for tree node click

    It's probably very easy and I just have brain freeze...

    I have an application that uses ColdFusion to provide data for the various controls. A control is a tree showing two levels of data (main level indicates the number of process and employment, then you open to see all event for this work numbers). It all works very well.

    Now, what I want to do, is when you select an even number, flex will use a coldfusion page, I put in place to perform a query on the database using the event number and the job number to get all its data in the task specific htat (description, duration of watering, etc.)

    I have the tree control click event works fine, I have the coldfusion page works very well, it generates a file in XML format with all the relevant details according to the settings that you send it. Now the question is, how to fill the form fields with the data returned by the query?

    I use an HTTPService call to get the data into ColdFusion (I have version 6.1 to Coldfusion).

    Thanks for any help.

    Well, I answered my own question... Here's what I did in case anyone wants to know. If there is a better way, please advise.

    I have an event click on the tree control. Given that the tree will be only two levels deep (parent and child) I test to see if the selected item is a parent. If so, I know that they have clicked on a child node. I then trigger the HTTPService with the parameters of child nodes and parent of the element in the tree that has been clicked.

    In the parameter of the HTTPService result, fill different fields using the syntax of lastresult.root.fieldname of the HTTPService.

    It works as expected, but there may be a better way?

Maybe you are looking for

  • Satellite M40-185 - Bluetooth is not ready - can not use

    I have the Satellite M40-185 I cann't use bluetooth. The problem is:At the opening of all programs--> Toshiba--> bluetooth--> bluetooth settings--> selection of menu bluetooth--> add new connection, a pop up appears with a msg "Bluetooth is not ready

  • Android is by train

    Installing Android 6 on my Moto X Pure publishing today. However, the installation is stuck in a loop at a point where it displays 'Android begins... '. Optimization of the app x 28 "where x increments at 28 then restarts and starts to say Android st

  • dlld:\source\spwizeng.dll is not a valid image

    Someone or microsoft has an answer for this problem dlld:\source\spwizeng.dll is not a valid image This happens when I try to reload the OS as well by running the program installation and boot using the cd of the OS. I tried different media... .the X

  • HP PHOTOSMART C7280: Airprint

    I have problems, try to use AirPrint my computer and the printer was purchased in 2008 is there a way I can update my printer so that I can print from my iPad and iPhone. I can print fine from my computer but would serve also to use my iPad and iPhon

  • Blue screen - locale 1033 - BCCode d1

    Hello Out of nowhere I just had a blue screen of death!  I have read a few other threads here and think I understand that I am able to get an analysis of the dump file that would help me to know what went wrong and what (s), maybe I need to update.