Expand my Community achievements bar.

RemoteObject without DataGrid fails

Avatar

Level 2
If I do not include a DataGrid somewhere in my Project,
RemoteObject call fails.



If this line is present there is no problem:



<mx:DataGrid />



But if I remove this line, I get the error: ArgumentError:
Error #2004: One of the parameters is invalid.



And the call fails: fault code = "Server.Acknowledge.Failed".



Of course I can simply set <mx:DataGrid visible="false"
/> and the problem disappears, but is this a bug?



Doug
5 Replies

Avatar

Employee
Hi Doug,

Are you still experiencing this issue?



If you have a reproducible test case, this would certainly be
a bug. Please post a simple code sample that fails for you and I'll
take a look. But I defintely have many examples using RemoteObject
without a dataGrid that work as expected. There is no connection
between the 2 components by default, so most likely the problems
lies elsewhere.



regards,

peter



Avatar

Level 2
Yes I still get the same error if I remove the mx:DataGrid
line even though the project has become enormously more complex
since my original posting.



I will try to set up a minimal project that shows the error
and post the code as soon as I can.



I must just add though that I am absolutely stunned and
amazed by what Flex and AS3 can do. It's absolutely brilliant.



Doug

Avatar

Level 2
Before I do that though, the error: one of the parameters is
invalid, suggests that my RemoteCall is missing a vital parameter
which is picked up by default from the DataGrid or its dataProvider
(I don't use a dataProvider either).



I pass only the destination and source, along with the
function name in the cfc e.g.



public function getData():void{

var svc:RemoteObject = new RemoteObject();

svc.destination = "ColdFusion";

svc.source = "mySite.myCFC";

svc.getcurrent.addEventListener("result", resultHandler);

svc.addEventListener("fault", faultHandler);

mx.managers.CursorManager.setBusyCursor();

svc.myfunction();

}



Is something else required?



Doug

Avatar

Level 2
I created a new project and copied two pages (the main page
with the mxml and a class page with a RemoteObject) out of the
original project and then cut out the lines not needed for these
two pages alone and tested with and without the DataGrid line.



No problem. Both worked.



Then I went back to my original project and that now works
without the line as well. It certainly still failed with the
DataGrid line missing until I created the new project, but now it
has no problem and yet is absolutely unchanged.



The fault arose originally when I was testing RemoteObject
and didn't have it set up correctly. At the time I had the result
bound to the DataGrid. Once I had the remote call working I removed
the binding and then the DataGrid and this is when I first noticed
the odd behavior.



The computer is switched off every day, and the main project
altered and recompiled and tested many times each day, yet the
fault has persisted for over a week up until I made the remote call
from a project that had never seen the fault and that seems to have
cleared the problem for the other project.



I can only hope that this can give you some clues if you
still think it's worth pursuing. Anyway, thanks to your request,
the fault for me is now gone.



Doug