Forum

Klaus79
Participant
    5 years, 10 months ago #19832
    Up
    0
    Down
    ::

    No, nothing changed.

    sap.ui.getCore().getEventBus().publish(this.getModuleName() + “ToApp”, “statusMessage”, adataForstatusMessage);

    the generated code “this.getModuleName() + “ToApp” creates in my oppinion the wrong channel name <modul_name>+”ToApp” (results in my example in:  “Password_ModulToApp”

     

    But if i change it to “Screen_StatusDialog” (channel will be found now) I get another error  “no event is registered” (see Simplifier code below).

    var aEventListeners  will be ‘undefined’.

     

    var aEventListeners = EventProvider.getEventList(oChannel)[sEventId];
    if (Array.isArray(aEventListeners)) {
    // this ensures no ‘concurrent modification exception’ occurs (e.g. an event listener deregisters itself).
    aEventListeners = aEventListeners.slice();
    var oInfo;
    for (var i = 0, iL = aEventListeners.length; i < iL; i++) {
    oInfo = aEventListeners[i];
    this._callListener(oInfo.fFunction, oInfo.oListener || this, sChannelId, sEventId, oData);
    }
    } else if (Log.isLoggable(Log.Level.DEBUG, “sap.ui.core.EventBus”)) {
    // no listeners
    Log.debug(“Failed to publish Event ‘” + sEventId + “‘ in ‘” + sChannelId + “‘.” + ” No listeners found.”, sChannelId + “#” + sEventId, “sap.ui.core.EventBus”);
    }