A
agent_008_nl
Guest
Hi, OE 11.3.0 (still have to install 11.5 on this machine). The unsubscribe below does not work, so I made a workaround. Is there something wrong with my call to unsubscribe? dataModel.setData = function(ttName, pagingData) { setDataCalls += 1; if (typeof pagingData === "undefined") { temptableName = ttName; pagingData = []; pagingData.push({PageNum:"1", RecordsPerPage:"20"}); // initially show page 1 with 20 records } var onAfterInvokeCustomRead = function (jsdo, success, request ) { jsdo.unsubscribe('afterInvoke', onAfterInvokeCustomRead, jsdo); var res = request.response; if (success) { res = res[Object.keys(res)[0]]; // SH Object.keys(res)[0] gets the first propertyname, it is the output parameter name (name of the dataset) res = res[Object.keys(res)[0]]; res = (temptableName !== "") ? res[temptableName] : res[Object.keys(res)[0]]; // SH no temptableName set? then it must be the first try{ jsdo.addRecords(res, progress.data.JSDO.MODE_EMPTY); } catch(e) { console.log("Error executing function in dataModel.setData: jsdo.addRecords, exception: " + e.message); } console.log("onAfterInvokeCustomRead"); eventManager.fireEvent("set-data", function(listener){ listener.listenerFunction(res); }); } else { if (res && res._errors && res._errors.length 0){ var lenErrors = res._errors.length; for (var idxError=0; idxError lenErrors; idxError++) { var errorEntry = res._errors[idxError]; var errorMsg = errorEntry._errorMsg; var errorNum = errorEntry._errorNum; /* handle error */ console.log("Error executing function onAfterInvokeCustomRead in dataModel.setData: " + errorMsg + ", messagenumber " + errorNum); } } } }; if (setDataCalls === 1) {jsdo.subscribe('afterInvoke', 'CustomRead', onAfterInvokeCustomRead);} jsdo.CustomRead({ttReadOptions:{ttReadOptions
agingData}}); } -- Kind regards, Stefan Houtzager Houtzager ICT consultancy & development www.linkedin.com/in/stefanhoutzager
Continue reading...
Continue reading...