Methods are not getting invoked for ExternalWidget

Following javascript code is written to implement external widget.

var d2OpenAjaxHub = new D2OpenAjaxHub();
function connectCompleted(hubClient, success, error) {
if (success) {
console.log("Hub client connected");
alert("Hub client connected");

    } else
        console.log("Hub client NOT connected - please check console");
}

/* Callback that is invoked upon widget activation*/
function onActiveWidget(bActiveFlag) {
    alert("onActiveWidget");
}

/* Callback that is invoked upon widget activation*/
function onDisplayedWidget(bDisplayedFlag) {
    alert("onDisplayedWidget");
}
function onInitWidget(message)
{
alert("onInitWidget");
}

function loadEvent() {
alert("load event ");

                    // Connect hubclient 
        d2OpenAjaxHub.connectHub(connectCompleted,onInitWidget,onActiveWidget);
        alert("load event end ");
      d2OpenAjaxHub.subscribeToChannels ("D2_EVENT_SELECT_OBJECT", eventHandlerCallback, true /*handle when inactive*/);

}

function eventHandlerCallback(name, msg) {

    alert("eventHandlerCallback");
}

function publishObjectSelection()
{

}

Following callback methods 'connectCompleted,onInitWidget,onActiveWidget' are not getting invoked while widget is getting initialized and activated.
Can you let us know if there is any wrong in my implementation.

Sign In or Register to comment.