Create a mobile Theme for Oracle APEX

This is Article #2 in my series about Oracle APEX on mobile Devices.

If you haven’t read the first one, please do so now.

This Article is based on the current release of Oracle APEX, but should also work on APEX 3.x and 4.1.
With Oracle APEX 4.1 and later there will be more options and possibilities which let you create an even better mobile Application, more to that in a later Article in this series.

This time we’ll start to build an Application which runs and adapts to mobile devices.

Create the Application

At first we create a new Application, pick any Theme you like but make sure that you don’t use Tabs.
The first/starting Page in our Application will consist of a List, which will be the main menu, and two other Pages with a Report and a Form. In my Demo Application I use the Table DEMO_CUSTOMERS which comes with the APEX Sample Application.

Demo Application in the Application Builder

Page 10 (Customers) is a classic SQL Report with that Statement:

, cust_last_name || ', ' || cust_first_name                                  AS TITLE
, cust_city ||', '|| cust_state ||', '|| cust_postal_code                    AS PLAIN_TEXT
from demo_customers

Page 11 (Customer) is a standard APEX-Form based on Table DEMO_CUSTOMERS (simply use the wizard to create it).

Page 1 contains a List-Region. At first create a new List (Main Menue) under Shared Components with a List entry pointing to Page 10. Then you can create the List-Region on Page 1 which uses this new list.

You can run this Application right away, but you’ll see that it isn’t rendered for mobile Devices. At this point it is just a normal APEX Application like all the other Applications you already have created.

create a new Page Template

Telling our Application to do some special rendering for mobile Devices is done with the Page Template. There we include jQuery mobile and define the required HTML5-Structure of the Page, as required per the jQuery mobile Documentation.

Now simply copy one of the existing Page Templates and replace the following code snippets in the respective options:

Page Template Header

<!DOCTYPE html>
<html lang="&BROWSER_LANGUAGE." xmlns=""
xmlns:htmldb="" xmlns:apex="">
<link rel="icon" href="#IMAGE_PREFIX#favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="#IMAGE_PREFIX#favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<body #ONLOAD#>
<div  data-role="page">

Page Template Body

      <div data-role="header" data-backbtn="false">
</div><!-- /header -->
<div data-role="content">
<ul data-role="listview">
</div><!-- /content -->

Page Template Footer

      <div data-role="footer">
</div><!-- /footer -->


Page Template Navigation Bar Entry

<a href="#LINK#" rel="external" #ALT#>#TEXT#</a>

Save the Page Template and set it as Default Template in the Theme Definition.
After starting the Application you can see a different Layout than before.
Application with mobile Page Template

create a new Region Template

Create a new and empty Region Template and copy this code:

Region Template Definition

<div data-role="controlgroup" data-type="horizontal">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE#

Again set this new Region Template as Default in the Theme Settings and use it in all already created Regions.
This now takes care of the Region Title and the Region Buttons, both are now rendered for mobile Devices.

create a List Template

The Home Page shall be the main Menu of the Application which is an APEX List. To make this look good and work on mobile Devices we need a new List Template with the following Definitions.

List Template Before Rows

<ul data-role="listview" data-inset="true">

List Template Current

<li><a href="#LINK#" rel="external">#TEXT#</a></li>

List Template Noncurrent

<li><a href="#LINK#" rel="external">#TEXT#</a></li>

List Template After Rows


After setting the new Template as Template for the List on Page 1 it instantly looks great.

Home Page with Main Menu for mobile Devices

create a Report Template

There is a vast variety on mobile Devices with differen Screen Sizes, Screen Resolutions and Capabilities. Standard APEX Reports won’t fit on most of the Screens, so we choose a different approach and create a Report Template for named Columns. This way we have more control over the Layout.

Create a new Report Row Template with the following Definitions:

Report Template Row Template 1

<a href="#LINK#" rel="external">

Report Template Before Rows

<ul data-role="listview">

Report Template After Rows


This Report Template expects that the Report SELECT Statement returns the Columns LINK, TITLE, BOLD_TEXT and PLAIN_TEXT. What you put in these Columns is totally up to you, just create any SELECT Statement and use the expected Column names as alias.

Using this new Template for our Report on Page 10 gives it a nice look.

APEX Report adapted to mobile Devices

As you can see we created a mobile Application with just a few changes on Templates. Of course this is just a first draft and there are some things to polish up and take care of (like Navigation, Buttons, Charts, …). See what’s possible in the mobile Demo Application

More tipps on APEX for mobile Devices in the next Article – so stay tuned!

Also Join me for a webinar on June 20th when I will go through my APEX for mobile project

55 thoughts on “Create a mobile Theme for Oracle APEX

  1. Hi Peter,

    In order pagination to work properly in reports, I added an “after refresh” dynamic action for the report region with this line of code:

  2. Hi Peter,

    I followed your tutorial exactly according to instructions and it works almost perfectly. There are some buttons that don’t seem to work well. The Logout button for instance. When I click on it (or touch from a smartphone) the loading spinner appears and stays there while the page doesn’t change. Although, I found that if I refresh the page after having clicked on the logout button, the session actually closes. I did some research but there is nothing that I find about this issue. (i’m using APEX 4.0)

    Regards, David

  3. ” …Create a new Report Row Template with the following Definitions:
    Report Template Row Template 1 …”

    I am using the jQuery theme and I can’t find the Row Template 1 anywhere in there. Can you please point me to where it is.
    Thank you.

  4. Hello , Peter Raganitsch .

    First congratulations on the excellent topic regarding Mobile has with jQuery .

    My name is Eric Novaes and I am Brazilian, I wonder if there would be conditions to share this application contained in link for study purposes .

    Thank you very much in advance.


Leave a Reply

Your email address will not be published. Required fields are marked *