It appears the error is because the object type sent to CF is not correct. I don't really know much more without seeing some code in how you are attacking all this. But from what I can gather here is you have some service returning a ArrayCollection of Contacts object instances that is fed to a DataGrid and from your info below it looks like you could have a add button that simply adds a 'blank' instance of Contacts (which probably should be named in the singular, but that's another discussion :) ) To add this you simply use myContacts.add( new Contacts()) where myContacts is your ArrayCollection of Contacts. Since you likely have your dataProvider bound to myContacts, when you add this new instance, you should see a blank row in your DataGrid right away, enter data into it and mash save. Provided your other code is able to handle this, that's it.
HTH DK On Mon, Jun 16, 2008 at 11:45 PM, Andre J. <[EMAIL PROTECTED]> wrote: > I have been following some web examples online about creating a CRUD > application in Flex and LCDS (via CF8) that uses the DataGrid to modify and > update a Database. As long as I have data in the database first, the read, > modify/update and delete functionality works. But I want to be able to > Create a new record in the database and the instruction (from the web > example) was: > > > > ------------------------------- > > Adding and removing items to the database is as trivial as adding a new item > to the ArrayCollection. > > > > ArrayCollection.addItem(new className()); > > ------------------------------- > > > > That got me lost. I understand the class stuff a little and understand the > structure of the class, but I can't seem to be able to figure out how to > create the correct function that will add records to the database from the > editable grid or from a form. I have done some research on the > <datagrid.addItem> command, and tried it and it will add new information to > the datagrid from the form, but when I attempt to update the database with > the <DataServiceID.commit() command I get the following error: > > > > RPC Fault faultString="Error during create: The BEAN argument passed to the > create function is not of type webexample.cfcs.contacts." faultCode="null" > faultDetail="null"] > > at > mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::dispatchFaultEvent()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\ConcreteDataService.as:2087] > > at > mx.data::CommitResponder/sendCommitEvent()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\CommitResponder.as:690] > > at > mx.data::CommitResponder/sendEvents()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\CommitResponder.as:675] > > at > mx.data::CommitResponder/dispatchFaultEvents()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\CommitResponder.as:505] > > at > mx.data::CommitResponder/result()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\CommitResponder.as:417] > > at > mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] > > at > NetConnectionMessageResponder/resultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:469] > > at > mx.messaging::MessageResponder/result()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:199] > > > > My question are: > > > > 1) What is the above error about? > > 2) How do I add a new record to my Flex/CF database via the editable > dataGrid? > > 3) How do I add a new record to my Flex/CF database via a form? > > > > Thanks in advance. > > > > Andrej770 > > ------------------------------------------------------------- > To unsubscribe from this list, simply email the list with unsubscribe in the > subject line > > For more info, see http://www.affug.com > Archive @ http://www.mail-archive.com/discussion%40affug.com/ > List hosted by FusionLink > ------------------------------------------------------------- -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? ------------------------------------------------------------- To unsubscribe from this list, simply email the list with unsubscribe in the subject line For more info, see http://www.affug.com Archive @ http://www.mail-archive.com/discussion%40affug.com/ List hosted by http://www.fusionlink.com -------------------------------------------------------------
