Not sure whether you want actionscript, or just a "how to", but I have done it 
in my app like this.

On update I send the data much like you have, and get the same data returned 
from amfphp. Then I just do an .addItem() call with the new data on the 
ArrayCollection that is binded to my datagrid, and then a .refresh() on my 
dataprovider. 

Doing it this way has its benefits:

- only partial updates, so don't have to get all data back.
- inserting return data (instead of directly from form) means you can have some 
validation and formatting on the server

But it also has it's downfalls:

- will not get new (or remove deleted) data that was updated outside of the 
current flex app

Hope this helps. 

Cheers,
Adam

  ----- Original Message ----- 
  From: munene_uk 
  To: [email protected] 
  Sent: Monday, February 05, 2007 3:14 AM
  Subject: [flexcoders] Refreshing Datagrid from pop up window


  I have a datagrid that retrieves user detials from a database using AMFPHP 
1.9. Within the same application, i also have an option for adding new users to 
the database via a custom pop window form. How can i get the datagrid to 
automatically update once i have sent the new users details to the database. 
I'm not using FDS because im not too sure whether its needed for  such a task.


  this is the code that sends the user details once you click "save"

     private function addStudent(details:Array):void
     {
                  
     myservice.getOperation('addStudent').send(details);
     PopUpManager.removePopUp(this);
     }

  I would i deally like to also make a call to  the main application in order 
to refresh the datagrid.


  So in short... how can i update the datagrid in my main application 
automatically from the pop up window?


   

Reply via email to