function saveIndi()
{
var gridLines:Array = new Array();
for( var cnt:Number = 0 ; cnt< resultSearchDataGrid.dataProvider.length ; cnt++)
{
var individual: Individual = new Individual();
individual.indi_first_name= resultSearchDataGrid.dataProvider[cnt].indi_first_name;
individual.indi_last_name= resultSearchDataGrid.dataProvider[cnt].indi_last_name;
gridLines[cnt] = individual;
}
oscAppRO.saveIndi( gridLines );
}
This doesn't work:
function saveIndi()
{
oscAppRO.saveIndi( resultSearchDataGrid.dataProvider );
}
My question is: Is it a bad practice to send as input parameter to the remote object the data provider? or should I transfer the data provider into an array of value objects first?
Any help would be greatly appreciated.
Thank you,
Valy
Peter Farland <[EMAIL PROTECTED]> wrote:
Have you tried changing your Java API to:public void saveIndi(Individual[] individuals)instead?-----Original Message-----
From: Valy Sivec [mailto:[EMAIL PROTECTED]
Sent: Monday, March 14, 2005 12:09 PM
To: [email protected]
Subject: RE: [flexcoders] Submit an editable gridPeter,Thank you for your message. I fixed the problem and what I have done is to iterate the datagrid provider and dump it into an array of AS2 value objects. and call the remote object like :function saveDataGrid()
{
var gridLines:Array = new Array();
for( var cnt:Number = 0 ; cnt< resultSearchDataGrid.dataProvider.length ; cnt++)
{
var individual: Individual = new Individual();
individual.indi_first_name= resultSearchDataGrid.dataProvider[cnt].indi_first_name;
individual.indi_last_name= resultSearchDataGrid.dataProvider[cnt].indi_last_name;
individual.indi_dob_long = resultSearchDataGrid.dataProvider[cnt].indi_dob_long;
individual.asset_values = resultSearchDataGrid.dataProvider[cnt].asset_values;
gridLines[cnt] = individual;
}
oscRO.saveIndi( gridLines );
}
The server side method is public void saveIndi( Object[] list);Is this redundant?Thanks,Valy
Peter Farland <[EMAIL PROTECTED]> wrote:What does the API for the "save" method on the RemoteObject service look like? If it is based on something generic, like java.util.Map, then it might leave a type as flashgateway.io.ASObject (which extends java.util.HashMap). If it's ArrayList, then it might not spot that it needs to make a conversion either. Try changing the API to an Array of YourValueObjectType....public boolean save(YourValueObjectType[] updates);-----Original Message-----
From: Valy Sivec [mailto:[EMAIL PROTECTED]
Sent: Monday, March 14, 2005 9:15 AM
To: [email protected]
Subject: [flexcoders] Submit an editable gridHello guys,I have an editable datagrid and a save button underneath. Each row from the datagrid is an "AS2" value object that is registered Object.registerClass. I edit the grid and hit the save button. I would expect to get on the server side an array of java value objects ( server side relative of the AS2 objects ) but I get an array of "flashgateway.io.ASObject". Is something am I missing? or is the right way it should be?Thanks,Valy
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.

