icon-arrow icon-check icon-mail icon-phone icon-facebook icon-linkedin icon-youtube icon-twitter icon-cheveron icon-download icon-instagram
Werken bij Whitehorses
Blog 17/10/2018

Using an improved JavaScript alert popup in APEX

Whitehorses

In APEX it is always possible to throw in a simple alert message for debugging your JavaScript. The alert message itself could be clicked away and it would stay away, so it is not very useful besides displaying a debug message.

More often do you need a user to display a certain message when the user has entered some data or just for displaying some information.

The following steps will let you define your own JavaScript alert model window, with your own message text, button text and it will have the same look and feel as the template for your APEX application.

This alert popup could help you redirect the workflow in a screen or just to clarify some steps.

First a simple variant of the alert window

In the Function and Global Variable Declaration add this JavaScript:

Create a Dynamic Action on Button:

In the JavaScript code of the Dynamic Action add this code:

BCB_ok ('Here you can have some text.<P>'+
                'And perhaps some more text.<P>'
              );

When pressing the Help button you get the following popup:

An alert window with 2 buttons

In the Function and Global Variable Declaration add this JavaScript:

On the button add this JavaScript code:

BCB_confirm ('Are you sure you want to submit the data?', 'SAVE');

The user will have this pop-up:

If the user presses the Yes button, APEX will continue submitting the data into the Page Processing with the request being: SAVE. The No button just closes the popup.

Popup alerts calling another

You can even have a popup alert opening another popup window:

On the button add this JavaScript code:

BCB_disapprove("How do you want to disapprove this case?"); 

The user will have this pop-up:

On pressing the Disapprove_and_renew button, the current popup closes and a new popup opens:

On pressing the Yes button here, APEX will submit the data into the Page Processing with the request being: DISAPPROVE_NEW. The No button just closes the popup.

overzicht blogs
Integratiespecialist
Michel Vogelpoel /
Integratiespecialist

Wil je deel uitmaken van een groep gedreven en ambitieuze integratiespecialisten? Stuur ons jouw CV!