Announcement

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

  • Warning message "no error message" after update of more than one row in a grid

    I have a ListGrid where I update a set of rows via javascript and save them with saveAllEdits().
    If more than one row is updated, I get a warning dialog with the message "Server returned SUCCESS with no error message performing operation 'foo_update'."
    The callback from saveAllEdits seems not to be called.
    What is wrong?
    How can I avoid this warning dialog?

    Code:
    09:54:35.305:TMR2:DEBUG:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):getRange(0, 3) satisfied from cache
    09:54:35.314:TMR2:INFO:RPCManager:sendQueue called with no current queue, ignoring
    09:54:35.325:TMR5:WARN:RPCManager:Multiple RPCRequests with params attribute in one transaction - merging
    09:54:35.325:TMR5:WARN:RPCManager:Multiple RPCRequests with params attribute in one transaction - merging
    09:54:35.326:TMR5:INFO:RPCManager:sendQueue[3]: 3 RPCRequest(s); transport: xmlHttpRequest; target: /foo/update
    09:54:35.330:TMR5:DEBUG:RPCManager:XMLHttpRequest POST to /foo/update?isc_dataFormat=json contentType: application/json with body -->{ "transaction": { "transactionNum": 3, "operations": [{
        "dataSource":"foo", 
        "operationType":"update", 
        "textMatchStyle":"exact", 
        "componentId":"fooList", 
        "data":{
            "id":1, 
            "value2":""
        }, 
        "oldValues":{
            "id":1, 
            "value1":"Hallo", 
            "value2":"doIt"
        }
    }, {
        "dataSource":"foo", 
        "operationType":"update", 
        "textMatchStyle":"exact", 
        "componentId":"fooList", 
        "data":{
            "id":2, 
            "value2":""
        }, 
        "oldValues":{
            "id":2, 
            "value1":"Welt", 
            "value2":"doIt"
        }
    }, {
        "dataSource":"foo", 
        "operationType":"update", 
        "textMatchStyle":"exact", 
        "componentId":"fooList", 
        "data":{
            "id":3, 
            "value2":""
        }, 
        "oldValues":{
            "id":3, 
            "value1":"!", 
            "value2":"doIt"
        }
    }]}}<--
    09:54:35.474:XRP7:INFO:RPCManager:transaction 3 arrived after 138ms
    09:54:35.475:XRP7:DEBUG:RPCManager:Result string for transaction 3: "{"response":[{"data":[{"id":1,"value1":"Hallo","value2":null}],"startRow":null,"endRow":null,"status":0,"totalRows":null},{"data":[{"id":2,"value1":"Welt","value2":null}],"startRow":null,"endRow":null,"status":0,"totalRows":null},{"data":[{"id":3,"value1":"!","value2":null}],"startRow":null,"endRow":null,"status":0,"totalRows":null}]}"
    09:54:35.482:XRP7:INFO:RPCManager:rpcResponse(unstructured) results -->{response: Array[3]}<--
    09:54:35.488:XRP7:DEBUG:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):dataSource data changed firing
    09:54:35.492:XRP7:INFO:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):updating cache in place after operationType: update, allMatchingRowsCached true
    09:54:35.494:XRP7:INFO:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):Updating cache: operationType 'update' submitted by 'fooList',3 rows update data:
    [
    {id: 1,
    value1: "Hallo",
    value2: null},
    {id: 2,
    value1: "Welt",
    value2: null},
    {id: 3,
    value1: "!",
    value2: null}
    ]
    09:54:35.497:XRP7:DEBUG:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):updated cache: 0 row(s) added, 3 row(s) updated, 0 row(s) removed.
    09:54:35.498:XRP7:INFO:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):doSort: sorting on properties [id] : directions [true] : full cache allows local sort
    09:54:35.509:XRP7:INFO:RPCManager:rpcResponse(unstructured) results -->undef<--
    09:54:35.589:XRP7:WARN:RPCManager:Server returned SUCCESS with no error message performing operation 'foo_update'. - response: {operationId: "foo_update",
    clientContext: undef,
    internalClientContext: Obj,
    context: Obj,
    transactionNum: 3,
    httpResponseCode: 200,
    httpResponseText: "{"response":[{"data":[{"id":1,"value1":"..."[336],
    xmlHttpRequest: [object XMLHttpRequest],
    transport: "xmlHttpRequest",
    status: 0,
    clientOnly: undef,
    httpHeaders: Obj,
    isStructured: true,
    callbackArgs: null,
    results: undef,
    data: undef}
    09:54:35.590:XRP7:INFO:RPCManager:rpcResponse(unstructured) results -->undef<--
    09:54:35.611:XRP7:WARN:RPCManager:Server returned SUCCESS with no error message performing operation 'foo_update'. - response: {operationId: "foo_update",
    clientContext: undef,
    internalClientContext: Obj,
    context: Obj,
    transactionNum: 3,
    httpResponseCode: 200,
    httpResponseText: "{"response":[{"data":[{"id":1,"value1":"..."[336],
    xmlHttpRequest: [object XMLHttpRequest],
    transport: "xmlHttpRequest",
    status: 0,
    clientOnly: undef,
    httpHeaders: Obj,
    isStructured: true,
    callbackArgs: null,
    results: undef,
    data: undef}
    09:54:35.616:XRP7:DEBUG:EventHandler:firing threadExitActions: [
    anonymous()
    ]
    09:54:35.668:TMR3:DEBUG:ResultSet:isc_ResultSet_0 (dataSource: foo, created by: fooList):getRange(0, 3) satisfied from cache
    09:54:35.674:TMR3:INFO:RPCManager:sendQueue called with no current queue, ignoring
    SmartClient Version: v12.0p_2018-11-13/LGPL Development Only (built 2018-11-13)

    This is the code for the web page.
    Code:
    <script>
    
    function doThings( what, viewer, records) {
        fooList.startEditing();
        var rows = [];
        for( i = 0; i < records.length; i++) {
            var record = records[i];
            var row = fooList.getRecordIndex( record);
            rows[i] = row;
            fooList.setEditValue( row, "value2", what);
        }
        fooList.endEditing();
        fooList.saveAllEdits( rows, function( dsResponse, dsRequest) { console.warn( "callback"); console.warn( dsResponse);});
    }
    
    isc.ListGrid.create({
        ID: "fooList",
        autodraw: false,
        width: "99%", 
        height: "450",
        autoFitWidthApproach: "both",
        autoFitFieldWidths: true,
        canSort: true,
        canGroupBy: true,
        showFilterEditor: true,
        alternateRecordStyles: true,
        dataSource: "foo",
        autoFetchData: true,
        selectionType: "multiple",
        canEdit: false,
        autoSaveEdits: false,
        initialSort: [
            { property: "id" }
        ],
        dataPageSize: 20,
        showRowNumbers: true,
        fields: [
            {name: "id", title: "ID"},
            {name: "value1", title: "Value 1"},
            {name: "value2", title: "Value 2"}
        ],
        editComplete: function( rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse) {
            console.warn( "editComplete for row " + rowNum);
            console.warn( dsResponse);
        },
        editFailed: function( rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse) {
            console.warn( "editFailed for row " + rowNum);
            console.warn( dsResponse);
        }
    });
    isc.IButton.create({
        ID: "doItButton",
        autodraw: false,
        title:"doIt",
        click: function () {
            doThings( "doIt", fooList, fooList.getSelectedRecords());
        }
    });
    isc.IButton.create({
        ID: "undoItButton",
        autodraw: false,
        title:"undoIt",
        click: function () {
            doThings( "", fooList, fooList.getSelectedRecords());
        }
    });
    </script>
    
    
    <div>
    <h1>Just a simple example</h1>
    </div>
    
    <div>
    <script>
    
    isc.VStack.create({
        ID: "main",
        position: "relative",
        width: "99%",
        defaultHeight: 15,
        overflow: "visible",
        membersMargin: 5,
        members: [ 
            fooList,
            doItButton,
            undoItButton
        ]
    });
    
    </script>
    </div>
    
    <!-- Die Konsole:
    -->
    <script>isc.showConsole()</script>
    The data source. Backend is written in ruby based on the article from wiki.
    Code:
    isc.RestDataSource.create({
        ID: "foo",
        fields: [
            {name: "id", type: "integer", primaryKey: true},
            {name: "value1", type: "text", length: 30},
            {name: "value2", type: "text", length: 30}
        ],
    
        dataFormat: "json",
        jsonPrefix: "",
        jsonSuffix: "",
        operationBindings: [
            {operationType: "fetch", dataProtocol: "postMessage", dataURL: "/foo/fetch"},
            {operationType: "update", dataProtocol: "postMessage", dataURL: "/foo/update"}
        ]
    });
Working...
X