Using toast/pop-up notifications

Parent Previous Next

If you want to get specific information to the user while they are completing a task, you can use toast notifications.


To generate toast notifications, you can use the following methods:


Both methods can be used to display a message. The difference is that the alert() method throws an exception, thereby stopping the execution of the script. The notify() method only causes an attempt to display a message pop-up in the user's web client asynchronously.


In addition to a message, both methods allow you to set a title, an icon and a timeout. With the exception of the message, however, the other parameters are optional.



alert(string message, string title, string iconname, int timeout)




notify(string message, string title, string iconname, int timeout)




If you set a timeout, the toast notification will disappear after the defined time. Otherwise, it remains until the user clicks it away.


For the parameter iconname, you can use the icons available in the web portal. You can find an overview here: https://www.iyopro.com/iyopro/Icons.htm. The icon is displayed in size 24.


Typical icons may be:

error

warning

info

help

hint

bell

alert



If you have an on-premises installation, you can also look up the existing icons in the icons directory of the frontend directory on the server on which your IYOPRO is installed. A long as you follow the naming scheme there, you may also add your own icons.