在自定义DirectUpdate之后调用WL.Client.invokeProcedure(Call WL.Client.invokeProcedure after custom DirectUpda

编程入门 行业动态 更新时间:2024-10-20 21:06:28
自定义DirectUpdate之后调用WL.Client.invokeProcedure(Call WL.Client.invokeProcedure after custom DirectUpdate)

我有一个类似的问题比使用适配器的MobileFirst Direct更新定制但是我没有使用适配器修改DirectUpdate,我试图在完成时记录DirectUpdate的状态,但似乎调用了适配器不起作用。 在DirectUpdate完成后,在main.js上调用WL.Client.invokeProcedure有任何限制吗?

更新,我的源代码:

/** * Busy indicator */ var busyInd; /** * Custom listener for MobileFirst DirectUpdate */ var directUpdateCustomListener = { /** * Call when DirectUpdate starts * @param totalSize */ onStart: function(totalSize){ console.log(JSON.stringify(totalSize)); busyInd = new WL.BusyIndicator("ion-side-menu-content", {text: MENSAJE_DIRECT_UPDATE}); busyInd.show(); }, /** * Call on every DirectUpdate step * @param status * @param totalSize * @param completedSize */ onProgress: function(status,totalSize,completedSize){ console.log('DirectUpdate-'+status+': -------- -------- ---------- ------------- PROGRESS: '+completedSize+' of '+totalSize); }, /** * Call when DirectUpdate finish * @param status Status of the finished DirectUpdate */ onFinish: function(status){ console.log(JSON.stringify(status)); busyInd.hide(); var options = { onSuccess: success, onFailure: fail }; function success(data) { var dataDirectUpdate = new Object(); dataDirectUpdate.device = data.deviceID; dataDirectUpdate.version = window.device.version; dataDirectUpdate.model = window.device.model; dataDirectUpdate.platform = window.device.platform; dataDirectUpdate.appVersion = WL.Client.getAppProperty(WL.AppProperty.APP_VERSION); dataDirectUpdate.status = status; console.log(JSON.stringify(dataDirectUpdate)); var invocationData = { adapter:"OracleAdapter", procedure:"directUpdateData", parameters: [dataDirectUpdate] }; function ProcSuccess(dataSuccess) { console.log('insert OK'+JSON.stringify(dataSuccess)); if (status == 'SUCCESS'){ WL.SimpleDialog.show('Title', 'Success', [{ text : 'OK', handler : function() { WL.Client.reloadApp(); } }] ); } else { WL.SimpleDialog.show(TITULO_DIRECT_UPDATE, ERROR_DIRECT_UPDATE, [{ text : 'OK', handler : function() { wl_directUpdateChallengeHandler.submitFailure(); } }] ); } } function ProcFail() { console.log('insert fail'); WL.SimpleDialog.show(TITULO_DIRECT_UPDATE, ERROR_DIRECT_UPDATE, [{ text : 'OK', handler : function() { wl_directUpdateChallengeHandler.submitFailure(); } }] ); } WL.Client.connect({ onSuccess: function(){ WL.Client.invokeProcedure(invocationData, { onSuccess: ProcSuccess, onFailure: ProcFail }); }, onFailure: ProcFail }); } function fail() { WL.SimpleDialog.show('Title', 'Error', [{ text : 'OK', handler : function() { wl_directUpdateChallengeHandler.submitFailure(); } }] ); } WL.Device.getID(options); } }; /** * Handler override to control MobileFirst DirectUpdate * @param directUpdateData Data from the DirectUpdate * @param directUpdateContext Java Object with context of the DirectUpdate */ wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData,directUpdateContext) { // custom WL.SimpleDialog for Direct Update console.log(JSON.stringify(directUpdateData)); WL.SimpleDialog.show('Title', 'Question', [{ text : 'OK', handler : function() { directUpdateContext.start(directUpdateCustomListener); // Additional code here. } }, { text : 'NO', handler : function() { //wl_directUpdateChallengeHandler.submitFailure(); // Additional code here. } }] ); };

I have a similar problem than MobileFirst Direct update customization using adapter But I'm not using the Adapter to modify the DirectUpdate, I'm trying to make a record about the state of the DirectUpdate when it finish, but seems that the call to the adapter not works. There is any restriction to call WL.Client.invokeProcedure on main.js after the DirectUpdate finish?

Update, my source code:

/** * Busy indicator */ var busyInd; /** * Custom listener for MobileFirst DirectUpdate */ var directUpdateCustomListener = { /** * Call when DirectUpdate starts * @param totalSize */ onStart: function(totalSize){ console.log(JSON.stringify(totalSize)); busyInd = new WL.BusyIndicator("ion-side-menu-content", {text: MENSAJE_DIRECT_UPDATE}); busyInd.show(); }, /** * Call on every DirectUpdate step * @param status * @param totalSize * @param completedSize */ onProgress: function(status,totalSize,completedSize){ console.log('DirectUpdate-'+status+': -------- -------- ---------- ------------- PROGRESS: '+completedSize+' of '+totalSize); }, /** * Call when DirectUpdate finish * @param status Status of the finished DirectUpdate */ onFinish: function(status){ console.log(JSON.stringify(status)); busyInd.hide(); var options = { onSuccess: success, onFailure: fail }; function success(data) { var dataDirectUpdate = new Object(); dataDirectUpdate.device = data.deviceID; dataDirectUpdate.version = window.device.version; dataDirectUpdate.model = window.device.model; dataDirectUpdate.platform = window.device.platform; dataDirectUpdate.appVersion = WL.Client.getAppProperty(WL.AppProperty.APP_VERSION); dataDirectUpdate.status = status; console.log(JSON.stringify(dataDirectUpdate)); var invocationData = { adapter:"OracleAdapter", procedure:"directUpdateData", parameters: [dataDirectUpdate] }; function ProcSuccess(dataSuccess) { console.log('insert OK'+JSON.stringify(dataSuccess)); if (status == 'SUCCESS'){ WL.SimpleDialog.show('Title', 'Success', [{ text : 'OK', handler : function() { WL.Client.reloadApp(); } }] ); } else { WL.SimpleDialog.show(TITULO_DIRECT_UPDATE, ERROR_DIRECT_UPDATE, [{ text : 'OK', handler : function() { wl_directUpdateChallengeHandler.submitFailure(); } }] ); } } function ProcFail() { console.log('insert fail'); WL.SimpleDialog.show(TITULO_DIRECT_UPDATE, ERROR_DIRECT_UPDATE, [{ text : 'OK', handler : function() { wl_directUpdateChallengeHandler.submitFailure(); } }] ); } WL.Client.connect({ onSuccess: function(){ WL.Client.invokeProcedure(invocationData, { onSuccess: ProcSuccess, onFailure: ProcFail }); }, onFailure: ProcFail }); } function fail() { WL.SimpleDialog.show('Title', 'Error', [{ text : 'OK', handler : function() { wl_directUpdateChallengeHandler.submitFailure(); } }] ); } WL.Device.getID(options); } }; /** * Handler override to control MobileFirst DirectUpdate * @param directUpdateData Data from the DirectUpdate * @param directUpdateContext Java Object with context of the DirectUpdate */ wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData,directUpdateContext) { // custom WL.SimpleDialog for Direct Update console.log(JSON.stringify(directUpdateData)); WL.SimpleDialog.show('Title', 'Question', [{ text : 'OK', handler : function() { directUpdateContext.start(directUpdateCustomListener); // Additional code here. } }, { text : 'NO', handler : function() { //wl_directUpdateChallengeHandler.submitFailure(); // Additional code here. } }] ); };

最满意答案

确认,按照我正在尝试的方式做到这一点是不可能的。 谢谢Idan Adar尝试帮助我。

Confirmed, it's impossible to do that in the way I'm trying to do. Thanks Idan Adar to try help me.

更多推荐

本文发布于:2023-08-04 07:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1412506.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   WL   DirectUpdate   Client   Call

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!