How to use adapter inside the application in worklight

房东的猫 提交于 2019-11-29 08:57:46

The call from an application to an adapter is the same for all types of adapters.

function getData() {
var invocationData = {
        adapter : 'ADAPTER_NAME',
        procedure : 'PROCEDURE_NAME',
        parameters : []
    };

WL.Client.invokeProcedure(invocationData,{
    onSuccess : getDataSuccess,
    onFailure : getDataFailure,
});
}

For more information check module 6 - Invoking Adapter Procedures from the Client Applications (PDF, 370KB) and the exercise and code sample (ZIP, 53.7KB)

Here i retrieved the values. but its not displaying in html page. this is my code

function wlCommonInit(){
    // Common initialization code goes here
    WL.Logger.debug("inside the wlcommoninit");
    busyIndicator = new WL.BusyIndicator('AppBody');
    getData();

}






function loadFeedsSuccess(result){
    WL.Logger.debug("Feed retrieve success");

}

function loadFeedsFailure(result){
    WL.Logger.error("Feed retrieve failure");

}


function getData() {
    var invocationData = {
            adapter : 'SqlAdap',
            procedure : 'procedure1',
            parameters : []
        };

    WL.Client.invokeProcedure(invocationData,{
        onSuccess :  loadFeedsSuccess,
        onFailure : loadFeedsFailure,
    });
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!