0
votes

in the Fiori Launchpad, while i'm in an application, if i click on my username and next on About, i get this nice pop-up with some information on my application. Now i understand that this is something that i can customize to be visible yes or no, but my question is: How can i access this dialog programmatically. If I click the link I do see Div "aboutContainerDialogID" appearing. That is however completely removed from the DOM once closed. I've searched in many standard SAP js files but was not successfull in tracing down the dialog.

My Goal: I want to bind a shortcut to this dialog. If the user enters the keyboard shortcut, the dialog has to appear. The shortcut i fixed, the dialog not yet. Any help or tips would be appreciated.

2

2 Answers

0
votes
sap.ui.getCore().byId("aboutBtn").firePress();

//better put in try catch method.. just in case about button is not available.

Update: The actions are built dynamically based on App and current screen user is in.

So when we use the above code, it may fail as @Matti said. the best possible solution I see is to trigger first press on actions button..

try{
    sap.ui.getCore().byId("aboutBtn").firePress();  
}catch(e){
    sap.ui.getCore().byId("actionsBtn").firePress(); //this creates action menu
    sap.ui.getCore().byId("aboutBtn").firePress();
}

I do agree that its not a clean solution. //will update if I find something better..

0
votes

Okay I have found a way of doing this without using the buttons. This enables it too also work when running with a headerless configuration. This is the code:

new sap.ushell.ui.footerbar.AboutButton().firePress();

I have the following function in my controller which I load on the onInit():

registerKeyListeners: function() {
  var map = [];
  onkeydown = onkeyup = function(e) { //eslint-disable-line
         e = e || event; //eslint-disable-line
         map[e.keyCode] = e.type === "keydown";
   };

   window.addEventListener("keydown", function(e) { //eslint-disable-line

          if (map[17] && map[112]) {
            new sap.ushell.ui.footerbar.AboutButton().firePress(); //eslint-disable-line
            map = [];
         }

   });
},

This allows me to use the combination of keys Control and F1 to request the information of the current application.