Blog

APEX

3 Reasons to use Inline Dialogs

When you create an APEX page you usually are given the choice of a Normal Page or a Modal Page.

I’m not going to go in to the detail of the differences or when to use one over the other – you probably already know this already and have been using them throughout your applications.

However, there are much more dialogs choices available, namely… non-modals, popups and inline-dialogs. By the way non-modal dialogs are great for help text or when you need to see the non-modal content and the application side by side without an overlay. The APEX debug window is a non-modal and is a great example of this use-case.

So now that leaves popup and inline-dialogs; they are pretty similar with the difference only really being a region header.

You may be reading this thinking… “I have made it this far using modal-dialogs: It’s unlikely I would need to consider alternatives.”

In response, there are scenarios where in-line dialogs give a performance increase over modal dialogs and there is a use-case where modal dialogs are simple not appropriate to use.

I give you 3 reasons where inline dialogs are superior to modal-dialogs.

As you read, you can try out the examples using my sample application.

1. Speed

Use-Case: Instructional Text; Reports

Inline dialogs are rendered on the parent page. Therefore, they are already rendered by the time you open the region. Compare this to opening a modal dialog, in which the page is subject to authorization schemes, security steps and the whole APEX engine firing up. Not to mention an Iframe being embedded and rendered on the client browser. When you have simply a piece of text to display to the user it’s not worth the cycles that a modal dialog takes. Using an inline-dialog makes your page snappier, sharp and responsive.

Because inline-dialogs are on the same page as the parent page; there’s no passing of parameters, no checksums, no dialog close events to catch (unless you want to).

2. Choice Selector

Use-case: When you want to give the users a choice between multiple answers.

In this scenario, you want a regular confirm message however the OK & Cancel button just doesn’t cover all the options you need.

You could make a modal dialog to cover all the options; however, its over-kill for such basic functionality – see point above.

A choice inline-dialog is easy to construct to meet this requirement

3. Great choice for Oracle Forms Redevelopments

Forms to APEX is the correct choice.

Multi-row Data Blocks to Interactive Grids is the correct choice.

On occasion, there is a need to use a master detail where the detail is in a dialog. The user should be able to navigate between the parent and the detail making modifications and, when ready, save those modifications. An example of this could be a search region (master) and the search results (detail).

If the detail is in a modal dialog, then APEX developer cannot make a master-detail connection between the master (on Page 1 for example) and the detail (on modal dialog Page 2 for example).

Quite often (and I do a lot of Forms to APEX re-development projects) an Inline Dialog is the answer.

Basics

The basics of inline-dialogs are simple

  1. Create a region of Template Inline Dialog and position Inline Dialogs
  2. Give it a static ID
  3. Open/Close it declaratively (APEX 19.1+)

If you don’t have APEX 19.1 then you can Open/Close it in JavaScript using

apex.theme.openRegion(“MyStaticID”);

apex.theme.closeRegion(“MyStaticID “);

Sample App

I’ve provided a sample application here in which you can try out a few examples.

https://apex.oracle.com/pls/apex/f?p=47872

 

Matt Mulvaney Contributor
Senior Oracle APEX Development Consultant , Explorer UK Ltd

Matt is an experienced APEX solution designer having designed numerous complex systems using a broad range of Oracle Technologies. Building on his previous experience of Oracle Forms & PL/SQL, he is entirely focused on providing functionally rich APEX solutions. Matt promotes APEX as a software platform and openly shares best practises, techniques & approaches. Matt has a passion for excellence and enjoys producing high quality software solutions which provide a real business benefit.

follow me

Dive straight into the feedback!
Login below and you can start commenting using your own user instantly