action “send to app” not working

  • Klaus79
        4 years ago #19824

        I do not get a channel from following code snippet.

        var oChannel = getChannel(this, sChannelId);
        if (!oChannel) {
        // no channel
        if (Log.isLoggable(Log.Level.DEBUG, “sap.ui.core.EventBus”)) {
        Log.debug(“Failed to publish into channel ‘” + sChannelId + “‘.” + ” No such channel.”, sChannelId, “sap.ui.core.EventBus”);
        }
        return;
        }

        Problem is following line: getChannel(this, sChannelId);

        getChannel returns ‘undefined’.

        sChannelId = Password_ModulToApp

         

        which channel/data is missing?

         

        Klaus79
            4 years ago #19825
            Up
            0
            Down
            ::

            there is no ‘Password_ModulToApp’ in oEventBus (see below).

            Name of ‘sChannelId’ is generated by Simplifier.

             

            oEventBus._mChannels

            [object]
            __proto__

            [object]
            ApplicationChannel

            [object (constructor)]
            Home

            [object (constructor)]
            Login

            [object (constructor)]
            Main

            [object (constructor)]
            sap.ui

            [object (constructor)]
            Screen_Approval

            [object (constructor)]
            Screen_Infosystem

            [object (constructor)]
            Screen_Main

            [object (constructor)]
            Screen_Password

            [object (constructor)]
            Screen_Roles

            [object (constructor)]
            Screen_StatusDialog

            [object (constructor)]
            Screen_User_Maintain

            [object (constructor)]
            Screen_valueHelp_Customer

            [object (constructor)]
            SuperAdministration

            [object (constructor)]

            Mathieu Roll
                Has successfully completed the online course Introduction
                Has successfully completed the online course Intermediate (200)
                Has successfully completed the online course Advanced (300)
                Has successfully completed the online course Basics (100)
              4 years ago #19829
              Up
              0
              Down
              ::

              Did you changed the Interface name in your module ?

              because this would perhaps be the problem.

              Klaus79
                  4 years 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”);
                  }

                   

                  Armin Winkler
                      Has successfully completed the online course Introduction
                      Has successfully completed the online course Intermediate (200)
                      Has successfully completed the online course Advanced (300)
                      Has successfully completed the online course Basics (100)
                    4 years ago #21773
                    Up
                    0
                    Down
                    ::

                    Hello,

                    is this problem still occuring inside of your application? There should have been a fix for this problem included in hotfix 69 for Simplifier release 5.0 if I read our internal release notes correctly.

                     

                    Regards,

                    Armin

                  Viewing 5 posts - 1 through 5 (of 5 total)

                  You must be logged in to reply to this topic.