Oracle APEX Application Page Mode

As an APEX developer, you have most likely encountered certain scenarios where you need to check whether a page is a modal dialog page or a regular page.

A regular or normal page in Oracle APEX refers to the standard webpage with content, navigation, and other interactive elements. It’s the page the user sees when they click open any URL. This can be the Homepage.

On the other hand, a modal dialog page refers to a smaller overlay or pop-up window that appears on top of the normal page. This dialog page is usually for specific interactions or tasks without requiring the user to navigate away from the main content. Think form submissions, newsletter sign-ups, or even discount alerts displayed a few seconds after a user lands on a site. Most times, The user has the freedom to discard this pop-up page by clicking a cancel button or “X” close modal icon; they may also interact with the page and register for whatever is shown.

In any case, interacting with the dialog page doesn’t take the user to another page.

But why exactly do developers need to identify between a dialog page and a regular one? Why can’t they just go ahead and work on the page without specifying?

Why Developers Need to Differentiate between Regular and Modal Pages

Now, here’s the deal – developers need to know when they’re dealing with these pop-ups versus regular pages. Why?

First off, these pop-ups, or modal dialogs, demand instant user attention. They guide users through a specific task without any distractions. So, being able to spot them helps developers tweak the user interface for a smoother experience, set up specific checks, and manage the overall flow of the app.

On the flip side, knowing when you’re on a regular page is equally important. These are your standard pages where users can freely navigate without any immediate interruptions. Think of it as the difference between a focused interaction and just cruising through the app.

Being able to tell these pages apart helps developers set up the right kind of navigation, create a consistent user experience, and even optimize things for different devices. So, it’s basically about making sure the app feels right for the user, whether they’re interacting with a pop-up or casually browsing a regular page.

Now, let’s talk about the two ways of identifying these pages in Oracle APEX.

The SQL Query Method

The SQL method is one way of checking whether the page you’re working on is modal. You conduct this check by implementing a SQL query against the APEX_APPLICATION_PAGES view. The query utilizes the APEX_APPLICATION_PAGES, which contains information about application pages, so it will tell you if the page is “NORMAL”  or not.

Below is the SQL query you should use:

As you can see, this query checks if the page you’re working on is “NORMAL’, meaning it’s not a modal page.

APEX API Method

The second method of checking whether a page is modal or normal is the APEX API Method. In this method, you simply use apex_page.get_page_mode. This method directly provides information about the page without any need for a SQL query.

Below is the line of code to use:

In this case, we are also checking to see if the current page is a normal one. The API method returns the page mode for the specified application and page.

Final Words

Identifying whether a page is a modal dialog or a regular page in Oracle APEX allows developers to tailor the user experience. When you know how the user will interact with the page in question, you can implement appropriate validation and confirmation mechanisms and optimize the application’s responsiveness accordingly.

Overall, this distinction will help you create a web app that is smooth and user-friendly for customers.

If you need an experienced APEX developer to help you on your low-code development project, give me a call today.

Share your love
Pierre Yotti
Pierre Yotti
Articles: 14