6 Replies Latest reply on Oct 13, 2006 12:25 PM by ntsiii

    Monitoring HTTP Service

    Freeseb Level 1
      Hi,

      I'm send 50 httpservice requests to store data in a database. I put it in a loop and I want to identify each time a httpservice call has ended to display progressio in a progress bar.

      Any idear how to identifier a request has ended?

      thanks
        • 1. Re: Monitoring HTTP Service
          upshotvideo Level 1
          use the "result" event. Result is what is fired when the service has been sent and has come back (when it's done).
          result = "function()"
          You could create some sort of counter or something in your function and display the progress.
          Why do you have so many httpServices? I'm sure you could combine those into one.
          • 2. Re: Monitoring HTTP Service
            Freeseb Level 1
            Because I use a dagagrid to edit 50 records from a mysql database : I fiil the datagrid, the user modify all records, then I delete the records fron the database...and I've 50 send() of httpservice : one for each line in the datagrid.

            Do you see anothr way?
            • 3. Re: Monitoring HTTP Service
              upshotvideo Level 1
              you should send one service with 50 POST variables with REQUEST, and have your php script use those values to do its query to modify the SQL table. an HttPservice should never have to send off more than once, you should be able to gather all the info you need and send it off ONCE.
              • 4. Re: Monitoring HTTP Service
                upshotvideo Level 1
                A good practice is to gather all your info for the datagrid through a service, then before putting the values in the datagrid, put the info into an arrayCollection. Then when you change the datagrid, the array changes too, so when it comes time to send off the values, just loop through that array to make your POST variables, and send it off.
                • 5. Re: Monitoring HTTP Service
                  Freeseb Level 1
                  Thanks, I undeerstanfd your logic but concretely I probably miss something : My datagrid if 20 columns and I've 50 lines. How to pass them with a loop to a php script? having Line1col1, line1col2... and how to get thme on the other side?
                  In case you've a very small example, I would appreciate a lot. Whatever, thanks for your comments. Seb
                  • 6. Re: Monitoring HTTP Service
                    ntsiii Level 3
                    One way is to build a SQL string in Flex, with 50 insert statements, then pass that to the server and execute it there.

                    Or loop over the dataProvider and build an xml string with the data to insert. Pass it to and parse it on the server and build the queries there.

                    Tracy