面對一個奇怪的問題,工作燈適配器無法從模擬器調用。 LogCat給出以下錯誤無法從android模擬器調用時調用工作燈適配器
07-02 20:56:59.063: D/DroidGap(873): onMessage(onNativeReady,null)
07-02 20:56:59.063: D/DroidGap(873): onMessage(onPageFinished,file:///data/data/com.PivMobileNew/files/www/default/PivMobileNew.html#clientListPage)
07-02 20:56:59.513: D/PivMobileNew(873): --------- $('#clientListPage').bind('pageinit', function(event){ ------------
07-02 20:57:00.673: E/PivMobileNew(873): [http://10.202.4.254:1028/worklight/apps/services/api/PivMobileNew/android/query] exception. undefined is not a function
07-02 20:57:00.823: D/CordovaLog(873): Uncaught TypeError: undefined is not a function
07-02 20:57:00.823: D/CordovaLog(873): file:///data/data/com.PivMobileNew/files/www/default/wlclient/js/worklight.js: Line 1467 : Uncaught TypeError: undefined is not a function
07-02 20:57:00.823: E/Web Console(873): Uncaught TypeError: undefined is not a function at file:///data/data/com.PivMobileNew/files/www/default/wlclient/js/worklight.js:1467
但是,從常見的調用適配器它工作正常。
這裏適配器調用代碼...
function GetClient(strClientName) {
var invocationData = {
adapter : 'PivMobileAdapter'
,procedure : 'getClient'
,parameters: [{"ClientName":strClientName}]
};
WL.Logger.debug(" --------- entered in function GetClient------- 2c");
try {
WL.Client.invokeProcedure(invocationData, {
onSuccess : handleSuccess,
onFailure : handleFailure,
});
}
catch (e)
{ WL.Logger.debug("---inside try catch, error occured while invokingProcedure----");
WL.Logger.debug(e.message);
}
function handleSuccess(result) {
WL.Logger.debug(" --------- inside handling success invoking procedure $('#searchNew').click(function() ------- 2c");
...some code here1...
...some code here2...
}
function handleFailure(result) {
WL.Logger.debug(" --------- inside handling failure invoking procedure $('#searchNew').click(function() ------- 2c");
...some code here1...
...some code here2...
}
}
不知道如何前進,誰能幫助?
使用調用適配器過程的JavaScript編輯您的問題。 –
添加了代碼。 – Rajiv
似乎它抱怨說它無法找到handleSuccess和handleFailure內部函數。 – tik27