0 Replies Latest reply on Apr 2, 2007 5:50 PM by dimival

    DataService createItem( ) question

    dimival Level 1
      I've been using DataServices to get a collection and then add, modify and delete items from it, and everytime i do this i get a refresh for that collection, that way i always have the latest changes on the items of the collection.

      Now i am trying to add a single item, without using a fill method first, but the thing is that after inserting it to the database i can't get an update of the item, because i didn't use a fill method before.
      The reason i need this is because the item's ID is not set in flex, it is set in java (using hibernate) because it is an autogenerated ID, so on Flex the item's ID is always null whereas in the database the item is inserted correctly with an autogenerated key.
      The problem like i said is that the object in flex remains with the null id and i can't find a way to update it automatically, so i am wondering if there's anyway to do this, that is to insert a new item using DataService.createItem() and then have an automatic update so the item on Flex is updated according to the values made on the database.

      Any help would be great, thanks