on 11-18-2018 6:06 AM
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
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
Creating and raising a custom JavaScript event
https://stackoverflow.com/questions/23344625/create-javascript-custom-event
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.