1 Reply Latest reply on Jul 24, 2007 12:49 AM by devhu

    LCDS application error on updateItem

    devhu
      Hi all,

      i'm having a problem with the LCDS.
      My application is almost copied from the sample application sample8 -> data management service. I can fetch the data to the datagrid from my MySQL server, but the update doesn't work at all. The returning object from the client is not Product, but for some reason flex.messaging.io.amf.ASObject

      here the debug from my app:
      Object type: flex.messaging.io.amf.ASObject
      field1: private boolean flex.messaging.io.amf.ASObject.inHashCode
      field2: private boolean flex.messaging.io.amf.ASObject.inToString
      field3: java.lang.String flex.messaging.io.amf.ASObject.namedType

      the same debug for the Sample8 app:
      Object type: flex.samples.product.Product
      field1: private java.lang.String flex.samples.product.Product.name
      field2: private java.lang.String flex.samples.product.Product.description
      field3: private java.lang.String flex.samples.product.Product.image
      field4: private java.lang.String flex.samples.product.Product.category
      field5: private double flex.samples.product.Product.price
      field6: private int flex.samples.product.Product.qtyInStock

      therefore i receive a classcastexception for the line in the ProductAssembler.java - function updateItem:
      boolean success = service.update((Product) newVersion);

      what i think is ok, because the newVersion is not Product but ASObject.

      But why the newVersion is ASObject and why not Product as in the sample app?

      thx
        • 1. Re: LCDS application error on updateItem
          devhu Level 1
          I've solved the problem...after days of coding...
          First of all, i forgot to add to my MXML file the <Product /> tag, to reference the Product.as, therefore the client returned the ASObject instead of Product.
          After this I received a stack overflow error. The problem was that I had the same name for Product.as, and Product.mxml.
          Renamed the mxml, and now the update works fine.

          Happy coding!