Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DynamicForm.saveData() not updating ListGrid

    I'm calling saveData() on a record in my form which correctly sends the update to my data source. However the linked ListGrid is not getting updated.

    The update call simply returns a (empty) 200 response, does it expect the updated record details in the body?

    Or is the problem something else?

    #2
    Yes, the response has to contain details of the updated record.

    Use firebug or fiddler to examine the response when you try to update a record in the RestDataSource sample

    Sanjiv

    Comment


      #3
      thanks for the reply.

      Is it feasible to override transformResponse() to workaround that?

      Comment


        #4
        An empty response should actually be considered valid, it causes the submitted values to be used as update data.

        Enable the "ResultSet" log category in the Developer Console to see what's going on.

        Yes, overriding transformResponse() and copying dsRequest.data to dsResponse.data would work as a workaround by the way.

        Comment


          #5
          all I'm seeing in the log is

          09:24:32.522:XRP6:WARN:RestDataSource:isc_OID_1:Evaluating JSON reply resulted in empty value. JSON text:
          ""

          Can the response body be entirely empty or does it require status or anything else.

          Comment


            #6
            I don't think you enabled the "ResultSet" log category as instructed - try again.

            Comment


              #7
              I think I did. ResultSet is now blue in the pulldown, and debug is ticked.

              Comment


                #8
                Then it seems like either your grid is bound to a different DataSource or the response is considered as a failure. Try your approach of overriding transformResponse() - this will also allow you to inspect what the RestDataSource thinks of your empty response (by looking at the default DSResponse).

                Comment


                  #9
                  Turned on debug as default level and get the following output (when server returns empty body):

                  15:16:49.342:MUP5:DEBUG:RPCManager:XMLHttpRequest POST to http://localhost:8182/contacts/17 contentType: application/x-www-form-urlencoded; charset=UTF-8 with body -->id=17&lastName=Black&hasChildren=false&firstName=Johnv&reference=/contacts/17&_selection_3=true&_operationType=update&_oldValues={id:17,lastName:"Black",hasChildren:"false",firstName:"John",reference:"/contacts/17",_selection_3:true}&_componentId=isc_OID_5&_dataSource=isc_OID_1<--
                  15:16:49.342:MUP5:DEBUG:EventHandler:Event 'click' bubbled to top
                  15:16:49.345:MMV8:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_EH_screenSpan]
                  15:16:49.394:XRP9:INFO:RPCManager:transaction 3 arrived after 53ms
                  15:16:49.394:XRP9:DEBUG:RPCManager:Result string for transaction 3: ""
                  15:16:49.394:XRP9:INFO:RPCManager:rpcResponse(unstructured) results -->""<--
                  15:16:49.394:XRP9:WARN:RestDataSource:isc_OID_1:Evaluating JSON reply resulted in empty value. JSON text:
                  ""


                  In addition if I change the server to instead return the updated entity then it works but the item in the ListGrid gets unselected. Not sure if that’s related but thought it worth mentioning.

                  Comment

                  Working...
                  X