Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

SAP Screen Personas


 

Scripting: Creating alert and confirmation dialogs with session.utils.showOptionDialog()


SAP SCREEN PERSONAS KNOWLEDGE BASE - by Tamas Hoznek , Clemens Gantert , Regina Sheynblat

Purpose

This article describes how to create alerts and confirmation dialogs in Personas Scripting with the method session.utils.showOptionDialog().

Overview

This article describes how to create alerts and confirmation dialogs in Personas Scripting with the method session.utils.showOptionDialog().

Creating a Dialog without Callback (Alert)

 

session.utils.showOptionDialog("My title", "my message", session.utils.MESSAGE_TYPE_INFORMATION, session.utils.MESSAGE_OPTION_OK, onOptionDialogClose, "1");

function onOptionDialogClose(decision, ID){}

This will display a popup window with the specified icon (information), title ("My title"), a text in the window as the message itself ("my message") and a single OK button to close the popup. It is similar to the JavaScript "alert" statement's result.

Creating a Dialog with Callback (Confirmation)

 

session.utils.showOptionDialog("My Dialog", "Do You want to continue?", session.utils.MESSAGE_TYPE_INFORMATION, session.utils.MESSAGE_OPTION_OKCANCEL, onOptionDialogClose, "1"); 

function onOptionDialogClose(decision, ID){ 
 session.utils.log(decision);
}

This will display a similar dialog popup but instead of just an OK button, it will also have a Cancel button, and the selected result can be evaluated within the onOptionDialogClose function. To see which other options are available to specify the icon and message option, use Ctrl+Space after session.utils.

The parameter ID is optional and it can be used to identify which popup window called the onOptionDialogClose function, in case there are multiple such dialogs called by the script.

Related Content

Related Search Terms:

SAP Screen Personas, Scripting

Related SAP Notes/KBAs