6 Replies Latest reply on Oct 4, 2007 1:07 AM by ab1301

    Refreshing List After httpService result

    ab1301 Level 1
      Well, these forums have been a disaster area the last few days, but this problem is killing me, so I guess I'll try posting. If you're reading this, I guess it worked.

      I have a list that shows the last result from an httpService GET call. I have other controls that resend the GET call when changes are made to the data on the server. For the purposes of debugging, I am changing the data on the server manually, and then using a button to resend the GET call. I can't seem to get the list to refresh to show the new data when a new GET call is made.

      This seems like it should be automatic, but apparently its not. Is this a bug? Is there something I'm supposed to do to make the list refresh? I've tried invalidateList(), validateDisplayList(), validateNow(), executeBindings(), and nothing I've found in the language reference works. The one obvious answer refresh() doesn't seem to work with lists, though I can't understand why.

      Attached is the code for the list, the httpService, and the button that resends the GET call.
        • 1. Re: Refreshing List After httpService result
          ab1301 Level 1
          OK, this is really driving me crazy now.

          I tried calling clearResult() on the httpService right before resending it, and the list now blinks out when the call is sent, but then the old data still pops back up! Even if I click refresh on the browser the old data still comes up!

          The only way to get the list to show the new data is to close the browser completely, and open the page again. What is going on here?
          • 2. Re: Refreshing List After httpService result

            I have same problem with flash plaer early. I think the source of this problem is a browser cache. Browser, to increase speed, continuosly transmit data from first request to /clubxmlgenerator.php

            You can try to add to url a random variable like /clubxmlgenerator.php?rnd=2354687 and change value of this variable at each request. So browser will think that it is different pages and will not cache it.
            • 3. Re: Refreshing List After httpService result
              Trevor Baker
              I agree that this is a caching problem. Use a sniffer to see what headers your web server is returning as a starting point.

              • 4. Refreshing List After httpService result
                ab1301 Level 1
                I don't think thats the answer. I tried adding a random variable to the GET url that changes with every call, with no result.

                I doubt its a browser problem, because it also happens when I run the swf directly from the flash player. Also, when I load the xml generator php page directly in my browser, it displays the xml, and when I change the data and hit refresh on the browser directly, the page changes. With the flex page, the data doesn't change even if I hit refresh on the browser! It only changes once I shut down the browser, open a new browser and re-open the page. Very frustrating. What else could be causing this?

                Even if you still think its the browser cache, how can I fix this in the flex app, so my page works regardless of what the user's browser cache is doing?
                • 5. Refreshing List After httpService result
                  ab1301 Level 1
                  This just gets weirder and weirder... I installed a sniffer per Trevor's suggestion. The sniffer shows that after the first GET call, no more calls are being made. Even when I hit the button with click="getClubInfo.send()" nothing happens. Even if I add click="getClubInfo.clearResult(); getClubInfo.send()" nothing happens... Insolent Flash disobeys a direct order!!!

                  Here is the header. I don't really see anything here that could be causing the problem... Does anyone else see anything that could be causing it? Are there any other ideas as to what's going on?

                  HTTP/1.1 200 OK
                  Date: Thu, 04 Oct 2007 07:22:11 GMT
                  Server: Apache/2.2.3 (Ubuntu) PHP/5.2.1
                  X-Powered-By: PHP/5.2.1
                  Content-Length: 1531
                  Keep-Alive: timeout=15, max=100
                  Connection: Keep-Alive
                  Content-Type: text/html; charset=UTF-8
                  • 6. Re: Refreshing List After httpService result
                    ab1301 Level 1
                    Too weird. I changed the method to POST, and put the following request as a child in the httpService, and now everything works perfectly. Anyway, now that it is at least working, I'm not going to spend a lot more energy on it, but for anyone who is having a similar problem, changing to POST and adding the request below makes it go away.

                    Out of curiosity, is there anyone who can explain why this happened, and why this change fixed it (or, for that matter, how I can get it to work using a GET call with no variables, which is really what it should be)?