Hari- THanks for your response. I tried that but I got a compilation error that "there is no method with the name MyPojo". I suppose that means I have to manually write the underlying ActionScript class for my Java POJO?
That just seems like a really bad implementation design b/c if MyPojo Java class changes, then I have to manually change my ActionScript class. urr...what am I missing?! --- "Doodi, Hari - BLS CTR" <[EMAIL PROTECTED]> wrote: > Try this..... > > <mx:script...> > var newObj:Object = new MyPojo(); // constructor of > your POJO > function addToGrid() { > newObj = remoteObj.getNewJob(); > myDataGrid.addItem(newObj); > } > </mx:script> > > Thanks! > Hari > > -----Original Message----- > From: flexcoders@yahoogroups.com > [mailto:[EMAIL PROTECTED] On > Behalf Of Kevin Ewok > Sent: Friday, May 27, 2005 9:46 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Converting Java POJO to > Actionscript Errors > > Gang- > I'm a newbie and all the flexdocs on MM's site > couldn't give me a > concrete answer. I have a datagrid that is populated > from an ArrayList > of POJO's (using the remote object). That works > fine. > > I then have another method that is called 30 seconds > later then > returns a single POJO (of the same type from the > POJOs returned in the > first method). I then try to add it to my datagrid > using the > myDatagrid.addItem(newObj), but I get the below > debug error. > > Warning: Reference to undeclared variable, > '_global.com.MyPojo' > at mx_utils_ClassUtil::findClass() > Warning: valueOf is not a function > at mx_utils_ClassUtil::getFlexClass() > > Is there a special way I need to declare 'newObj' > (which I pass into > the datagrid.addItem() method), or do I have to > explicity write the > AS-equilavent class of my Java POJO class? > > I would think Flex could convert this class for me, > but I'm obviously > missing an important step to add it to the > datagrid/dataprovider. > Thanks in advance for your help. > > <mx:script...> > var newObj:Object; > function addToGrid() { > newObj = remoteObj.getNewJob(); > myDataGrid.addItem(newObj); > } > </mx:script> > > <mx:DataGrid id="myDataGrid" > dataProvider="{remoteObj.getAll.result}"> > ... > > > > > > Yahoo! Groups Links > > > > > > __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/