cancel
Showing results for 
Search instead for 
Did you mean: 

trigger web dynpro action from ui5

Former Member
0 Kudos

hi,

i embedded a web dynpro application with a html container in an ui5 app. now i want to trigger an action of the running wd-app with a button in the ui5 app. i implemented a workaround with a flag and some code in the onmodify-method that requires a button-click in the wd-app. any other suggestions?

thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

maheshpalavalli
Active Contributor
0 Kudos

Hi Bastian,

Basically you need to call the webdynpro action from your UI5 application.. for this I've done a similar requirement in the past but it's not the UI5 + wd.. I think you can use abap channels to execute this scenario or a normal registering event and raising it from UI5 app approach

Two ways

1. You need to put a html island(dummy) in your webdynpro and need to register for a push channel in your html container and call that even from UI5 application.. it's a long process..

2. You can register for a window event in the same html island and raise the event from UI5 application.. you can find many blogs in stackoverflow on how to create html events..

HTML island + Push Channel

https://blogs.sap.com/2014/10/16/real-time-notifications-and-workflow-using-abap-push-channels-webso...

Creating and raising a custom JavaScript event

https://stackoverflow.com/questions/23344625/create-javascript-custom-event

BR,

Mahesh

maheshpalavalli
Active Contributor
0 Kudos

I tried one test application without event or Push channel but used HTML island and added a window method.

Create HTML Island:

Now Add the event & Script methods

In the event element, as per the blog that I've pasted, create the action in it, in which you will call your button logic or simply mention the existing button action there.

In the script,

var MySocket = { 
      init: function(callback){
           var oCallback = callback;
           window.customVolaMethod = function(){ 
// Not sure what will be repercussion of directly adding method in window
                 oCallback.fireEvent('VOLA_EVENT');
           }
      }
};


Now call that window method inside your fiori app, it will work.. worked for me..

BR,

Mahesh