Several HTTPService calls...

Several HTTPService calls to different XML files...

I have several XML files with data. They all have the same structure but different content. I want to call these XML files and display them in the same provision, having a substitute the previous result. Sounds simple, but I are confused...

Let's say I have two buttons of the HTTPService calls,
< mx:Button... click = "Serv1.send ()" >
< mx:Button... click = "Serv2.send ()" >

< mx:HTTPService id = "Serv1" url = "data1.xml" >
< mx:HTTPService id = "Serv2" url = "data2.xml" >

I have a provision any which goes something like this...
< mx:TileList... dataprovider="{Serv1.lastResult.collection.object}"/ >

Let's say I want the second button and call Serv2 and its results place in the TileList. I read about ArrayCollections and models and by sending the service-results of a function and import utilities and result of the event, but I'm a little confused.

QUESTION:
Can I just that and please correctly interpret me here... "Serv1.result = Serv2.result;" If you catch my drift?

PS: As you can imagine, I had trouble getting a thing going and expanded on it quite well and all I want is to add another button, without having to redo everything from scratch...

Ok. To make it work.


public function copyHTTP (): void {}
SERV1 = Serv2;
}



Tags: Flex

Similar Questions

  • I received several phone calls from a person claiming there is problem on my pc

    original title: phone calls

    I received several phone calls from a person claiming it is your business. Is this a real employee with your company? He says there is a problem with my PC and he can fix my computer. Is it a scam?

    Please see the article on the link below.
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-security/i-received-a-phone-callemail-from-someone-saying/968f23dc-b7c1-4C8E-95A2-f89dde500ab8

  • I think I got several phony calls claiming that my computer is infected with spyware.

    I think I got several phony calls claiming that my computer is infected with spyware. They said that they were connected with Windows, so I asked if they were Microsoft and they said that no Microsoft would not call me. Wouldn't be a darn good Microsoft. The guy was Indian or Pakistani and wouldn't give me a company name, no matter how many times I asked.

    They said they received reports from my computer it has been infected. The last call I let them go through their process to prove to myself that my computer has been infected. They told me to go to the event viewer, logs of windows, applications and said there will be errors and warnings there.

    It was proof that he was infected and that they wanted to give me their approval to scan my computer so their 'Microsoft engineers' can solve the problem with Windows tools. At this point, after 20 minutes, I denied their access to the computer and hung up that it had no proof that I was worried. One of our friends had the same call on fixing Windows sound, she had an Apple Mac, I would have liked to see their difficulty its version of Windows.

    I have 3 questions for this and they are: -.

    1 can. anyone if your computer is infected using the event viewer?

    2 can they tell if she is infected when the computer has a firewall and is also behind a router with a firewall?

    3. I would be right in thinking that there is another form of the scam fake phone call?

    1. If possible, get the errors or warnings in the event viewer is quite common, but say you have a virus just based on that, it's simply stupid.

    2. they do what is called call cold. They call every phone # in the phone book and say "your computer is infected" even if you do not, Yes, it's a scam and yes they are stupid.

    3. Yes. The only way they would be able to tell if your computer has a virus would be if they had access to it, and if they have BEEN with microsoft, which is not, it would be a breach of privacy.

  • Can I add several function calls application CreationComplete?

    Hello

    I need to call two functions when the application is launched. How can I do this?

    Thanks in advance.

    POOJA

    I think what said Sri is that you try to process the result data just after the call to the function that sends the request.  HTTPService calls are time consuming, so you can't expect to have the results for the following line of code.  Instead, you addEventListener to hts to listen to a RESULT event.  In the event handler, do you the things you have coded to func1.  Like this:

    
    http://www.adobe.com/2006/mxml" xmlns:Components = "com.hillelcoren.components.*" creationComplete="CreationCompleteHandler()" layout="absolute">
    
    
    
     
    
    
     
        
    
    

    This is the basic idea.  You want a default event handler to intercept the events of the fault where the file was not present, etc.

    In this way, you make sure that the result is back before trying to process the data.

    -Marty [ http://www.theflexguy.com ]

    The useful answer? Please mark it as such.

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

  • Why the method in the several times called session bean

    Hello
    I work with Jdev 11 g.
    I created an example Web J2ee Application.
    In the model project, I created:
    1 - entity Bean
    2 - stateless session bean (which contains a method that get the list of username == > em.createNamedQuery("OsaUser.findAll").getResultList ();)

    In the view controller project I created:
    1 - managed bean, session scope, a getter that calls the session bean and retrieve the result of the query.
    2 - a JSF page with af:table element with the value bound to the list in the managed bean.

    When I run the application, the data is displayed, but since I put system.out message I get this message several times.
    When I try to debug the application the breakpoints on the managed bean and session bean are available several times.

    Can you please advice why this happens.
    Concerning
    Emile BITAR

    Hello

    partially, it's the cycle of life and partially a known bug. The method is called during ApplyRequest and RenderResponse. If you check this in your output, so you see that make answer calls at least three times, which is the bug that we set. As a temporary work around, set a flag within the scope of the request (since your bean's scope of session that you use a requestScope attribute). The first time you run, you set the attribute flag. So every time its called again, you check to see if the indicator exists and if ignore the request. Because the flag is set to request scope, you needn't clean it explicitly

    Frank

  • Has had several phone calls from so-called people representing Microsoft wanting to do an audit on the performance of MY COMPUTER. Is this a valid request or a scam?

    Phone calls from people with barely passable English so hard to understand. They are supposed to represent Microsoft and demand to go to the line so they can check the preformance of my Windows System.

    Have now had 3 calls in two days, but I hung up, there is no way to confirm that they are, in fact, Microsoft.

    Is this a common scam?

    It is a scam.

    Microsoft will never give you an unsolicited telephone call.

    HTH,
    JW

  • Several remoteObject call several CFC

    Hello

    I can't figure out how to get multiple CFC data in the same page using < mx:remoteObject / >
    and get the two datagrids to show data to the loading of the page. If someone could put the example code that would be great.
    I "ve google and google but can't find an answer.

    Here is my code work, but I think I'm close.

    ---------------------------------------------------------------------
    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "vertical".
    initialize = "Employees" >

    < mx:Script >
    <! [CDATA]

    Import mx.collections.ArrayCollection;
    Import mx.rpc.events.ResultEvent;

    [Bindable] private var emplist:ArrayCollection;
    [Bindable] private var deptlist:ArrayCollection;
    private void dataHandler(event:ResultEvent):void
    {
    EMPLIST = new collection ArrayCollection (event.result as Array);
    deptlist = new collection ArrayCollection (event.result as Array);
    }


    []] >
    < / mx:Script >

    < mx:RemoteObject
    destination = "ColdFusion".
    ID = 'employees '.
    source = 'flexprojects. StaffDirectory.cfc.employeesGateway ".
    result = "dataHandler (Event)" showBusyCursor = "true" "
    / >

    < mx:RemoteObject
    destination = "ColdFusion".
    ID = "departments."
    source = 'flexprojects. StaffDirectory.cfc.DeparmentsGateway ".
    result = "dataHandler (Event)" "
    showBusyCursor = "true".
    / >

    < mx:DataGrid dataProvider = "{emplist}" >
    < mx:columns >
    < mx:DataGridColumn dataField = "first name" headerText = "First name" editable = "true" / >
    < mx:DataGridColumn dataField = "lastname" headerText = "Last Name" editable = "true" / >
    < / mx:columns >
    < / mx:DataGrid >


    < mx:DataGrid dataProvider = "{emplist}" / >

    < / mx:Application >
    ------------------------------------------------------------------------------------------

    Thank you
    Gerd

    GERD,

    Try using the creationComplete attribute in the Application tag. Call a function that calls both of your CFC. and try to use two separate result management functions.

    http://www.Adobe.com/2006/mxml"layout ="vertical ".
    creationComplete = "init ()" > "


    Import mx.collections.ArrayCollection;
    Import mx.rpc.events.ResultEvent;

    [Bindable]
    private var emplist:ArrayCollection;
    [Bindable]
    private var deptlist:ArrayCollection;

    public void init (): void {}
    Employees.functionNameInCFC ();
    Departments.functionNameInCFC ();
    }

    private void empDataHandler(event:ResultEvent):void {}
    EMPLIST = new collection ArrayCollection (event.result as Array);
    }

    private void depDataHandler(event:ResultEvent):void {}
    deptlist = new collection ArrayCollection (event.result as Array);
    }
    ]]>

    <>
    destination = "ColdFusion".
    ID = 'employees '.
    source = 'flexprojects. StaffDirectory.cfc.employeesGateway ".
    result = "empDataHandler (Event)" showBusyCursor = "true" "
    />
    <>
    destination = "ColdFusion".
    ID = "departments."
    source = 'flexprojects. StaffDirectory.cfc.DeparmentsGateway ".
    result = "depDataHandler (Event)" "
    showBusyCursor = "true".
    />


    I hope this helps!

    James

  • Optimization, so or several function calls?

    Which one would be best?  This is the code that must decide what to do with each increase in decimal, 10/100/1000... up to 1 m.  'value' increases by 1 whenever an event occurs, if it's important to decide who is most optimal

    I think that the first would be the best way to do it, with multiple functions?

    for (var x = 10; value % x == 0 && x < 1,000,001; x *= 10){
     this[ "functionName_" + x.toString() ](x);
    }
    
    
    
    

    or

    for(var x = 10; value % x == 0 && x < 1,000,001; x*=10){
      if(x == 10){
       //do 10 effect
      } else if (x == 100){
       //do 100 effect
      } else if (x == 1000){
       //do 1k effect
      } else if...{
       //all values up to 1m
      }
    }
    
    
    
    

    Bingo, the more of the less successful appeals, as it gets.

    Your best bet if you really need Super optimization it is to test to do a test of pressure, but in general, except if there is crazy heavy lifting where functions, is not watch much (until it does).

    So, I would first look at the code it fires like your not getting a very complex logic. Personally, I think that your first solution is very elegant, even if a function is a little more taxing (in theory - as it all depends on what happens in the script executed).

    If its really critical test both and see what works best.

  • Several buttons call function to link to a unique URL?

    Howdy,

    So, I've got tons o ' buttons that each must make a link to unique URLS, and I want to minimize as much as possible of coding.  The code below works, but I'll have to do it about 50 times. Can I associate URLS with the button instance names and then reuse the same function?

    In case you don't to already guess, I am a newbie to AS3

    cap_mc. CapTeam_btn.addEventListener (MouseEvent.CLICK, capPage);

    function capPage (evtObj:MouseEvent) {}
    trace ("clicked")
    var url: String = " " http://www.mydomain.com ";
    var request: URLRequest = new URLRequest (url);
    try {}
    navigateToURL (request, "_blank");
    } catch (error) {}
    trace ("Error occurred!");
    }

    }

    Thanks in advance!

    You can.  the easiest way is to use a movieclip button (because the movieclip class is dynamic you can add properties):

    cap_mc. CapTeam_mc.addEventListener (MouseEvent.CLICK, capPage);

    cap_mc. CapTeam_mc.urlS = "http://www.mydomain.com."

    function capPage (e:MouseEvent) {}

    navigateToURL (new URLRequest (e.currentTarget.urlS));

    }

    but you can also create an object to associate the button names with url strings and still use the buttons.

  • Flex running on Firefox vs IE

    I put my app on the web today ' hui - it works perfectly on Firefox, but IE it fails to display an updated version of a datagrid when the information is added to or deleted from the data grid. I also tested the application of a machine not having a version cached the file on each browser.

    Someone at - he heard of this before?

    I discovered that the problem was that IE caches several HTTPService calls and that the code should be added to override the caching.

  • Preventing caching

    Yesterday, I posted a question on how to prevent caching when you use several HTTPService calls: the response has been to send a stamp of time with the other variables. It works perfectly in Firefox, but it doesn't seem to make it work in IE where caching continues to take place. Is there another way to make sure a HTTPService crosses instead of Saute one previously returned in a database?

    Place the 2 following lines of code in a file attached to all the php files includes:
    Prevent caching of data with IE broswer Flex
    header ("Cache-Control: must-revalidate, non-cache");
    header ("Expires: Saturday, July 26, 1997 05:00:00 GMT");

    Here is a link that describes the problem:
    http://livedocs.Adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=live Docs_Book_Parts & file = performance_118_13.html

  • call and re - with httpservice

    Here's a strange thing, that I came across today. I have a program that requests a DB via a script called with httpservice aspx. A user clicks on a name, the tracks of the query and fills in a form with data from the database. The user can then change the information and send the form to another script that makes changes to the DB. That everything works except that when the user click again on the same name, the old information is returned. I checked the DB is being altered with the submission script. If I close the application and reopen it and reselect the user, changed data are there. Is there something I'm missing the httpservice call? I tried to set up the table used for NULL result data. I even put just a text field on the page and print the results of the query to it. It also shows old data. It seems that it's actually not rerun the query as it should, but rather taking the values of a place in memory until I close the application and reopen it. Any ideas?

    The relevant parts of my code are displayed.

    You're right... it turns out that I needed to get the POST instead of GET method. POST does not use the cache, while GET work. Thank you.

  • Profile of Skype have not all contacts photos while in a group call

    Hi I'm currently using Skype Version 7.4.0.102 on Windows 7 that what Skype tells me, is the most up-to-date version. I recently upgraded to Skype and never sicnce I updated, I'll have the persistent problem of which is when im in a group with several people call, when people join the appeal it does display all contact with the images that are currently in the appeal / joined the call. This a problem that I see that people have joined in the call and who do not have.

    Anyone else having this problem or knows how to fix?

    Thank you very much

    Nathan

    NathanHopton wrote:

    I recently upgraded to Skype and never sicnce I updated, I'll have the persistent problem of which is when im in a group with several people call, when people join the appeal it does display all contact with the images that are currently in the appeal / joined the call.

    Hello and welcome to the Skype community.

    It is a known issue and a fix is being developed. My apologies for the inconvenience.

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • VI first very slow remote call

    My sequences include several call to vi on a PXI chassis.  PXI is running Labview.  The first time that a stage with a remote vi runs, nothing seems to happen as long as 30 seconds.  Subsequent executions of the same step instantly produce unless the code of the module is unloaded.  My hunch is that Labview PXI is looking for all the Subvi remote VI.  Optimize the search may have helped PXI a little path.  But what really helps is to explicitly call the server PXI Labview vi within a module of code runs locally using vi references.  In this case, even the first call is seemingly instantaneous.  If anyone has experienced this?  Anyone understand it?

    Now, I have converted several remote calls VI to prototypes local but the VI path on the remote server specified in the Advanced pane.  I get significantly improve performance.

Maybe you are looking for

  • We'll see how it goes

    super slow!

  • How to restore my computer?

    Hello. I have a problem with my computer. I wanted to restore my computer for some reason. The problem is that a few days ago I opened it and almost all of the programs and applications have been removed and obviously I do not know why. Even when I o

  • Problem-m8400f Desktop vid card

    PC = HP Pavilion Media Center m8400f desktop PC OS = Windows Vista Ultimate 32 bit I am trying to install a new video card. The card is an EVGA Geforce GTX570. The card does not have due to the motherboard sata connections. Is there any type of adapt

  • PS3 controller

    I have a ps3 controller. I downloaded MotionJoy latest drivers to connect with laptop.and, it works very well with widows vista. However when I try to use labview to acquire the input of the controller, it does not detect the controller. Why labview

  • Error message: "the AC adapter type cannot be determined." when connecting to the CA DELL 90W Adapter

    My power adapter is plugged into my laptop, but it is not the battery.  I could use the computer plugged into it.  The message I get is "AC adapter type cannot be determined.  This is the adapter supplied with the notebook, which is DELL 90W AC adapt