Customizing your APEX 5.1 Log-In Page

Have you ever wondered how to customize your Log-In page in APEX 5.1? If so this blog is for you. For demonstration purposes create a one page Desktop application in APEX 5.1 and use the default theme ie the Universal Theme. I’ve also used the default style in my example ie Vita (Accessibility Tested). When I run my application the Log-In page currently looks like this:

Functional, but a little bit boring. Let’s have a look at ways of “jazzing” it up a bit.

Start by going to Page Designer for the Log-In page (usually page number 101). Click on the Log In region – in 5.1 this is automatically called the same as the application name. In my example it is called Play Time – that’s why Play Time appears on the region.

Changing the icon displayed above the application’s name

Under the Appearance  section click on the  to the right of the Icon CSS Classes field and select an icon – I’m going with a cloud – fa-cloud to be precise. Save and Run Page and it should look like this:

Adding a background image to the page.

First upload the image you want to use via the Shared Components section – mine is called backgroundBluBubbles.jpg.

As you can see I uploaded it as a Static Application File hence the reference to APP_IMAGES in the code below. Go to the Page attributes of your Log In page and add the following in the CSS Inline field:
.t-PageBody–login .t-Body {
background: url(&APP_IMAGES.backgroundBluBubbles.jpg);
background-size: 100% auto;
}

Now your Log In page should look like this:

Changing the icons used for the items

If you want to you could also change the icons that show instead of the labels for the username and password fields ie

Go to the properties of the P101_USERNAME item and under Appearance  change the image via the Icon CSS Classes field.

If you do the same for P101_PASSWORD when you run your page you will see the icons you picked displayed rather than the default ones.

What’s Oracle APEX all about?

In this blog I shall try and introduce you to the basics of Oracle Application Express (APEX) and some of the background to the product.

What is APEX?

Oracle Application Express (also called APEX and formally called HTMLDB) is a web-based development environment for building dynamic web-based database applications.
It provides developers with the ability to create simple and complex web applications. These can consist of forms, reports, menus, tabs, breadcrumbs etc.  It also allows the developer to execute SQL and PL/SQL statements. We can create tables, views, indexes etc. from within the Oracle APEX product in the same way as we would by using Oracle SQL*Plus or Oracle’s SQL Developer. To learn more about APEX go to Oracle’s own application here – interestingly this is also written in APEX!

One of the key features of APEX is that all development takes place in a web browser such as Chrome, Firefox, etc. Oracle APEX is unlike some other Oracle development tools (e.g. Oracle Forms) in that no additional software needs to be installed on the developer’s PC.  When applications are deployed to end users machines they require no additional software, as the application is launched from within a browser.

History of APEX

Oracle APEX (APEX) was introduced as an Oracle Product in 2004.  Since then there have been a number of main releases of the product:

Oracle HTMLDB version 1.5
Oracle HTMLDB version 1.6
Oracle HTMLDB/APEX version 2 (released September 2005)
Oracle Application Express 2.2 (released August 2006)
Oracle Application Express 3 (released March 2007)
Oracle Application Express 3.1 (released February 2008)
Oracle Application Express 3.2 (released February 2009)
Oracle Application Express 4 (released September 2010)
Oracle Application Express 4.1 (released August 2011)
Oracle Application Express 4.2 (released October 2012)
Oracle Application Express 5 (released April 2015)
Oracle Application Express 5.1 (released December 2016)

It is currently included with the 11g and 12c Databases.  However it is possible to download the most recent version of APEX from the Oracle Technology Network. You will need an Oracle Database version 11.2 or higher to run the most recent version of APEX ie 1.5. It can also be installed in Oracle 11gXE (Express) version. For more information regarding the installation requirement visit here

At the time of blogging there is no additional license charge for APEX as it is included with the Oracle Database license.

Basic APEX Architecture

In addition to an Oracle Database the Oracle Application Express architecture requires some form of Web server to proxy requests between a Web browser and the Oracle Application Express engine. There are three options for configuring the web server:

  1. Oracle HTTP Server with mod_plsql
  2. Embedded PL/SQL Gateway (EPG)
  3. Oracle REST Data Services (formally Oracle Application Express Listener)

Oracle HTTP Server
The Oracle HTTP Server (Oracles web server) is based on the Apache web server.  Oracle introduced a module to the Oracle HTTP Server called mod_plsql which allows requests to execute PL/SQL code to be passed via a URL to the Oracle database for processing.

Embedded P/SQL Gateway
Starting with Oracle Database 10gXE and more recently 11g and 12c, you can use the embedded PL/SQL gateway. The embedded PL/SQL gateway is installed with Oracle Database 11and does not require the Oracle HTTP Server. It provides the Oracle Database with a web server and the necessary infrastructure to create dynamic applications. The embedded PL/SQL gateway runs in the Oracle XML DB HTTP Server in the Oracle Database. It includes the core features of mod_plsql.

Oracle REST Data Services (formally the Oracle Application Express Listener)
Oracle REST Data Services (ORDS) is a Java-based interface that communicates directly with the APEX engine, thus eliminating the need for mod_plsql. It can be installed in a J2EE application server such as Weblogic, Glassfish or Tomcat or can be installed in stand-alone mode for testing purposes. To run APEX 5.1 you will need at ORDS release 2.0.3 or later.

Oracle APEX 5.1 – Tabular Forms

OK I know everyone is raving about the new editable interactive grids but some users find them a bit “busy”…. They don’t want or need all the “”Actions” stuff. If this sounds familiar then all is not lost. Oracle have very kindly kept the old type of tabular form available – at least in 5.1.

If you are creating a new page then to include the old tabular form skip to the bottom of the page creation options and select Legacy Page.

Then you’ll see the Tabular Form option along with some other legacy page types:

If you want to add a Tabular Form (or any of the other older types) on an existing page there is a Show Legacy/Unsupported option at the bottom of the Type select list – click on that and you will see a number of the old region types appear in the select list:

 

 

What is Oracle APEX’s Page Zero / Global Page?

In previous older release of Oracle APEX – or at least before version 4.1 we had something called Page Zero. In APEX 4.2 and 5 these are now known as Global Pages. 

A Global Page is a special page. Unlike all other pages it has no processes, validations or branches. It functions as a master page in that APEX renders all the components you add to this page onto every page within your application. And just like virtually all the other parts in your application you can define your own conditions on the page and its components. 
So you can now create a region once and it will display on as many pages in your application as you want rather than you having to create it on every page. You can add a Global Page to any type of application –  and you can  add a separate one for each user interface – mobile or desktop.
 
Its uses?  
A Global Page is useful for:
  • Conditional items 
  • Commonly Used Regions
  • Lists
  • Items which will nearly always be displayed
  • Breadcrumb menus

Be careful not to confuse this page type with page templates. Page templates will always display static content where as a global page can conditionally display dynamic content.

How to create one
Create a new page and select the last option entitled “Global Page”.

Allocate a page number, by default it will be 0, and finally click on the “Ceate” button to create the page.
If you now look at the page in Page Designer you will see it doesn’t allow you to create any Processes like “normal” pages do. It is just a blank:
Another peculiarity of the Global Page is that you can’t run it independently. If you try clicking on the Run and Save Page button the following will appear:

Oracle APEX 5 New Features training

With many companies making the move from various older versions of Oracle Application Express to version 5. I have put together a two day new features course aimed at those with a good working knowledge of versions 4,4.1 or 4.2. The full course content can be found here. In brief the course covers the following topics:

  • Overview of the new Page Designer
  • Interactive Reports
  • Security Enhancements
  • User Interface Features
  • Miscellaneous but useful things….
  • Upgrading applications to APEX 5

Oracle APEX 4.2 – Saving a tree’s state

One of the questions raised in a recent Oracle APEX beginner’s course I was running, concerned the tree structure. We had just created two regions on a page – a tree region based on the EMP table and a form based on the same table. The idea was that when the user clicked on an employee’s name the form automatically populated with that employee’s details – giving me an opportunity not only to talk about trees but also the LINK option.  So we all ended up with a page similar to the one below.

That all worked fine…and then the question came….”when I click on an employee, the form populates but the tree refreshes and all my tree nodes are collapsed except for one. How can I save or cache the tree so that when the page refreshes the tree doesn’t alter?”

Now in older versions of APEX (ie anything before 4.0 if I remember rightly) we used to have to write a lot of code to do this. However we are now in the days of APEX 4.0 (or higher) and the tree structure uses jsTree, a JavaScript-based tree component that features, amongst other things, optional state saving and it is sooooooooo easy to implement.

All you need to do is edit your tree. Go to the ‘Tree Attributes’ page and set the ‘Selected Node Page Item’ to a page or application item that you wish to hold the selected node value e.g. P20_EMPNO as in my example below. Now when you select a node, and return to the tree page, the tree will expand to that last selected node.

The reason I picked that particular item is because it already exists on my page  – as a hidden item that is part of the form. It holds the primary key coulmn value so is already in the LINK column in my SQL query ie

Hey presto – a happy delegate 🙂

Oracle APEX – Talking the APEX talk

This is yet another topic that arose from a recent introduction to APEX course I taught in the UK. As part of one delegate’s introduction he said when he was with experienced APEX developers he easily got confused with all the APEX jargon that was getting bandied about – workspaces/applications/websheets and a whole lot more besides. Once one delegate started the ball rolling a few others also chimed in to say they had the same problem. So I thought a blog might be a quick fix – although our Introduction to APEX course deals with all these things in much more detail! Continue reading Oracle APEX – Talking the APEX talk

Oracle APEX 4, 4.1 and 4.2 New Features training

With many companies making the move from various older versions of Oracle Application Express to version 4, 4.1 or 4.2 I have put together a two day new features course aimed at those with a good working knowledge of version 3, 3.1 or 3.2. The full course content can be found here. In brief the course covers the following topics:

  • New Application Builder user interface
  • APEX Administration Enhancements
  • Team Development Functionality
  • Introducing Dynamic Actions
  • Enhancements to Validations
  • Enhancements to Tabular Forms
  • Enhancement to Interactive Reports
  • Enhancements to Charts and Calendar
  • Introducing Plug-Ins
  • Enhancements to web services
  • Websheets
  • Use of ROWID
  • Data upload
  • Improved error handling
  • Mobile applications
Please note all the content of our training courses is customisable to match the needs of our customers. Also there is a fixed price regardless of whether you want the training for one or ten people. For further information please contact Rowan Training

Oracle APEX On-line Training

Rowan Training now offers live instructor-led classes right from your computer. We use Cisco’s WebEx technology to provide you with all the benefits and personal contact of classroom instruction right from your desktop. This allows for less disruption by limiting the time spent away from work and home. You get the same valuable content and instructor interaction as you would in the classroom but with the convenience and cost effectiveness of being on-line. Continue reading Oracle APEX On-line Training