This content has been marked as final. Show 6 replies
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.
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?
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.
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.
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
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.