OracleAPEX Interior
OracleAPEX Interior
ISBN 978-1-64760-813-2
This book has been published with all reasonable efforts taken to make the material error-free
after the consent of the author. No part of this book shall be used, reproduced in any manner
whatsoever without written permission from the author, except in the case of brief quotations
embodied in critical articles and reviews.
While every effort has been made to avoid any mistake or omission, this publication is being
sold on the condition and understanding that neither the author nor the publishers or printers
would be liable in any manner to any person by reason of any mistake or omission in this
publication or for any action taken or omitted to be taken or advice rendered or accepted on
the basis of this work. For any defect in printing or binding the publishers will be liable only to
replace the defective copy by another copy of this work then available.
TABLE OF CONTENTS
3
CONTENTS
4
CONTENTS
List........................................................................................................................................................... 87
List View ................................................................................................................................................ 90
Map Chart ............................................................................................................................................. 93
Plsql Dynamic Content....................................................................................................................... 97
Reflow Report ..................................................................................................................................... 101
Region Display Selector ....................................................................................................................103
Static Content ..................................................................................................................................... 105
Tree .......................................................................................................................................................121
Items ............................................................................................................................. 127
Checkbox .............................................................................................................................................127
Display Image ..................................................................................................................................... 130
File Browse ..........................................................................................................................................132
Hidden .................................................................................................................................................141
List Manager .......................................................................................................................................146
Number Field ......................................................................................................................................149
Password ..............................................................................................................................................153
Radio Group .......................................................................................................................................158
Rich Text Editor ................................................................................................................................. 163
SELECT LIST ......................................................................................................................................166
Shuttle ..................................................................................................................................................171
TEXT FIELD .......................................................................................................................................174
CUSTOMIZATION ..........................................................................................................................175
Text field with Auto Complete........................................................................................................177
Page Designer item attributes..........................................................................................................178
5
CONTENTS
6
CONTENTS
Breadcrumbs .......................................................................................................................................216
Navigation Bar List ............................................................................................................................217
User Interface ............................................................................................................... 217
User Interface Attributes ..................................................................................................................217
Themes .................................................................................................................................................219
Templates ............................................................................................................................................222
FILES ............................................................................................................................ 224
Static Application Files .....................................................................................................................224
Static Workspace Files ......................................................................................................................225
REPORTS ..................................................................................................................... 227
Report Queries ................................................................................................................................... 227
Report Layout ..................................................................................................................................... 228
Globalization ................................................................................................................ 229
Globalization Attributes ...................................................................................................................229
Text Messages ..................................................................................................................................... 232
Translate Application........................................................................................................................233
CHAPTER 10: INTEGRATION WITH OTHER DATABASE
WITHOUT DBLINK …..……………………………………………………………......... 235
ABOUT DOYENSYS …..……………………………………………………………......... 241
ABOUT THE AUTHORS…..…………………………………………………………….. 245
7
CHAPTER
1
INTRODUCTION
This is a no cost feature of oracle which means you need not spend a penny over the
license cost of oracle database. This can run on any oracle database like XE, EE or SE.
Oracle Apex has many built-in features such as user interface themes, navigation controls,
form handlers, and reports. Oracle Application Express accelerates the application
development process to a greater extent.
As an end user or a business user you only need a web browser to access the
application built on APEX. The popularity of the web based application is humongous as
we need not install a number of software to client system, and as and when we need an
update or enhancement we can do in the server itself. This makes the web based application
a major go to solution.
You can create application using the inbuilt wizards creating components like
pages, items, buttons etc. These data entered in each wizard will be saved and archived in
9
ORACLE APEX
Oracle table as Oracle Apex is built using SQL and PLSQL. Developer can use SQL and
PLSQL for server side, and HTML, CSS, and JAVASCRIPT for client side condition.
Oracle Apex enables the developer to customize the inbuilt components based on the
customer’s requirement, making it a tailor fit for them which we will be covering in this
book.
10
CHAPTER
2
ARCHITECTURE
Oracle Apex is a simple 3 tier architecture, which consists of the following—Browser (client
side), ORDS (Oracle Rest Data Service), Oracle Apex engine. The request from the client
browser is sent to the oracle database as PL/SQL call via ORDS and the request is processed
in APEX engine; in other terms oracle database then sends it back to the browser for the
client.
ORDS
ORDS is the abbreviation of Oracle Rest Data Service. It is a Java program that allows the
user to interact with the oracle database via REST service. The SQL or PL/SQL call from the
browser is transmitted to the oracle database and the result set from the Oracle Database is
sent back to the ORDS which transforms the output to JSON format which will be sent
back to the browser.
https://docs.oracle.com/cd/E11882_01/appdev.112/e11947/start_arch.htm#HTMDB25001
11
ORACLE APEX
In Oracle database 10g and 11g there was 2 tier architecture where the mod_pls gate way is
replaced as embedded PL_SQL gateway.
https://docs.oracle.com/cd/E11882_01/appdev.112/e11947/start_arch.htm#HTMDB25001
12
CHAPTER
3
SKILLS REQUIRED
Oracle Apex developer is someone who is proficient in using oracle database as a powerful
RAD platform. The Developer must possess the following skills and we can further drill
down to mandatory and optional skills, where the mandatory skills are ones without which
one cannot develop the application, and the optional skills are needed only for making your
application visually appealing and for customizing the in-built functionality.
MANDATORY SKILLS
Oracle Application Express
Oracle SQL
Oracle PL/SQL
Oracle Data Modelling
Oracle Database performance and tuning
OPTIONAL SKILLS
HTML5
CSS
Web design
Data security
Web security
13
ORACLE APEX
Someone can be called as Oracle APEX developer only if he or she is proficient in at least
three of the mandatory skills. If you excel in some of the optional skills, you can be a
pleasing developer of oracle APEX.
Note: At Doyensys, we hire people who are experts in Oracle Apex and possess any one of
the above skills and hands on experience in them.
14
CHAPTER
4
PROS AND CONS OF ORACLE APEX
ADVANTAGES
It’s FREEE!!! Probably we would say it’s a no cost feature given by Oracle. As you
pay for Oracle database, this comes as a value added service. This comes with all the
versions as XE, EE, etc.
It’s a RAD (Rapid Application Development) tool which helps the developer to
develop an application in a fast and secure manner.
It’s a low-code development environment, where we can write the code, and the
tool will take off some of the development process. Hence we will have both secured
and fast development. In the other scenario, if the tool generates the whole code
and if the developer is not allowed to change it, then security will be a major
concern, even though the development timing will be greatly reduced. But if the
developer needs to do full coding, which in turn will be a time consuming process,
it will greatly increase the development time. The below graph shows the
advantages of low-code development.
15
ORACLE APEX
DISADVANTAGES
There is no version management in Oracle APEX which takes rework if changes are
needed to the previous versions.
16
CHAPTER
5
ROAD MAP OF APEX
Oracle APEX was developed way back in 2004 when it was called HDML Db, which was
the first release. In each version Oracle added a functionality to make it a good product.
Oracle concentrated on each technology at each release, like in version 2, it was added with
SQL workshop, where it acts as GUI for executing query, which has query builder as inbuilt
for the ease of developers. Then they moved on in improving the user interface where they
have built charts and reports. Later they have added migration guide and support for
Oracle Forms to APEX, which enable all the Oracle forms users to switch to latest
technology, and helped them to speed up their development. Without some energy the
application will not feel lively, hence they added dynamic action and plugins which were
handled by the developers using JavaScript. Inclusion of team development added an
advantage for the team of members to track the progress of the development.
The concentration of Oracle turned to mobile application as the world has shrunk
to individuals’ palms, and hence it’s time for technology to adapt itself for the same. Hence
they added a responsive theme which will cater to this requirement of changing the display
based on the screen resolution.
17
ORACLE APEX
Source: Oracle
https://www.oracle.com/technetwork/developer-tools/apex/overview/apex-overview-otn-
4491378.pdf
18
CHAPTER
6
QUICK TOUR TO APEX
In this chapter we will take you through the different modules in Oracle Apex, their
functionalities and uses. The following are the four major modules in Oracle Apex.
Application Builder
SQL Workshop
Team Development
App Gallery
APPLICATION BUILDER
Application builder is the place where the developer can create applications which are
composed of several HTML pages based on the Database objects
Application builder is further classified into create, import, dashboard, and utilities,
where using create option developer can create database application or spread sheet
19
ORACLE APEX
application or he/she may choose from the preinstalled application which is provided by
Oracle.
Import – this is the option where the developers can import the existing application which
is exported as .sql file. This option also enables developers to import and use other objects
like plugin themes; images can also be imported from other workspaces to the current one.
This is how we deploy the application to the production. We can export the application
from UAT environment and import it to production.
20
QUICK TOUR TO APEX
Dashboard – It’s the combination of different reports and charts about the activities of the
user and the activities done over the application.
Workspace Utilities – These utilities are the ones we have in the workspace details app
builder; defaults is for setting the default, and manage news is to display news about the
application, and workspace themes is to change and add themes, rest enabled SQL services
is to manage endpoint urls, and the export option is used for exporting the workspace
components
21
ORACLE APEX
SQL WORKSHOP
SQL workshop provides you a GUI (Graphical User Interface) for managing database
objects such as tables, views, functions, procedures, packages, etc. This is further
modularized as the following:
Object Browser.
SQL Commands.
SQL Scripts.
Utilities.
RESTful Services.
OBJECT BROWSER
This page has two panes—one is the Selection pane and the other is the Details pane. The
Selection pane enables the developer to browse through the database objects. He/she may
also use the search bar to narrow down the results. The developer can view the details of
the object by using the tabs in the details pane for the selected object.
22
QUICK TOUR TO APEX
SQL COMMANDS
This is the work place where the developer can execute the SQL scripts or queries. The
results of the query can be viewed in the result tab. We can also see the explain plan for the
query for tuning the performance of the query. You can save the query if needed for future
reference. If you forget to save, the history tab will help you to find the series of executed
queries.
SQL SCRIPTS
This module is for managing the scripts which are needed for the application. Say
Doyensys has created an application for managing Item master in EBS suite using Oracle
Apex, and we have a client asking for the same. Hence we load all the scripts for database
object creation; master data insertion can be added and executed after the installation.
23
ORACLE APEX
UTILITIES
There are different utilities in SQL workshop as follows:
Data Workshop -- Load or unload data using CSV, XLSX, XML or JSON files.
Query Builder -- Build queries graphically by adding tables into a panel, and selecting
columns to return.
Quick SQL -- Generate SQL using shorthand syntax.
Sample Datasets -- Install, refresh, or remove sample datasets.
Generate DDL -- Generate scripts for all or selected database objects within a schema.
User Interface Defaults -- Specify layout properties to consistently generate items /
columns across pages and applications.
Schema Comparison -- Show differences between database objects in two different
schemas.
Methods on Tables -- Generate API scripts for DML operations on specified tables.
Recycle Bin -- Restore database objects that have been dropped.
Object Reports -- Access numerous reports on tables, exceptions, security, objects and
PL/SQL code.
About Database -- Review database details. For this schema needs DBA role.
Database Monitor -- Run database activity reports. For this schema needs DBA role is
required.
24
QUICK TOUR TO APEX
BEGIN
ORDS.enable_schema(
p_enabled => TRUE,
p_schema => 'TESTUSER1',
p_url_mapping_type => 'BASE_PATH',
p_url_mapping_pattern => 'testuser1',
p_auto_rest_auth => FALSE
);
END;
And we have different API for creation services and methods like GET, PUT, and DELETE
for the data manipulation and review.
BEGIN
25
ORACLE APEX
ORDS.define_service(
p_module_name => 'testmodule1',
p_base_path => 'testmodule1/',
p_pattern => 'emp/',
p_method => 'GET',
p_source_type => ORDS.source_type_collection_feed,
p_source => 'SELECT * FROM emp',
p_items_per_page => 0);
END;
Team Development
This module is for the managing and tracking the development activities of the application.
We can split the application to modules and add to the milestone and to-do list. The
feedback is the place where the end user’s feedback will be displayed to the developers.
26
QUICK TOUR TO APEX
App Gallery
Application gallery is the place where Oracle has loaded the prebuilt application
27
CHAPTER
7
APEX PAGE COMPONENTS
Regions
Breadcrumb
Breadcrumb provides users with hierarchical navigation view. You can display a
breadcrumb as a list of links or as a breadcrumb path.
Breadcrumb Creation
You can create Breadcrumb by using two methods:
Creating Breadcrumb manually
Creating Breadcrumb while creating a Page
29
ORACLE APEX
30
APEX PAGE COMPONENTS
Step 3: Create a new Breadcrumb, by clicking the “Create Breadcrumb” Button and give
the Breadcrumb name
Step 4: Now the breadcrumb has been created with a name “Breadcrumbdev”.
31
ORACLE APEX
Step 7: Select the Page No and Short name to display in a Navigation List as a Parent tab.
32
APEX PAGE COMPONENTS
Here we are setting the Parent Entry as Breadcrumb which we have created above.
Step 9: For Page 3, we have given a breadcrumb short name as “Breadcrumb Sub page”.
Step 10: Now the Breadcrumb has been Created and below are the steps to include the
Breadcrumb in our Page Region
Step 11: Create a new Region in Page 3, with title “BreadCrumb Example”
Step 12: In Type, Select “Breadcrumb”
Step 13: In Source, Select Breadcrumb name that we created on Shared Component
“Breadcrumbdev”.
33
ORACLE APEX
Step 14: Now “Save & Run” the Page. We are able to view the BreadCrumb Region with
List type
Step 15: It will display as a hierarchical list; you can select the “Breadcrumb” list, to move
for Page 2.
34
APEX PAGE COMPONENTS
Step 4: Now the Page has been created with Breadcrumb Region.
35
ORACLE APEX
Step 5: You can select the Breadcrumb list to navigate to the corresponding Pages.
Changing the Appearance of Breadcrumb
By Default, Template for breadcrumb is “Title Bar”.
We can change the template of Breadcrumb in below mentioned types
In this we have chosen “Collapsible”. Now the Page 7 will appear in the below format.
36
APEX PAGE COMPONENTS
Creating Calendars
App Builder includes support for creating a calendar with monthly, weekly, daily, and list
views. Once you specify the table on which the calendar is based, you can create drill-down
links to information stored in specific columns and enable drag and drop capability.
App Builder supports two types of calendars: Calendar and Legacy Calendar.
Sample Calendar – You can view a sample calendar by installing the sample
application, Sample Database Application or the Sample Calendar application.
Adding a Calendar to a New Page Using a Local Database
o Run the Create Page Wizard to create a new page with a calendar using a
local database.
Adding a Calendar on a New Page Using Remote Database References.
o Run the Create Page Wizard to add a new page with a calendar that uses a
remote database reference.
Creating a Calendar in Page Designer
o Manually create a calendar in Page Designer by providing the SQL query.
Managing Calendar Attributes
o Once you create a calendar, you can alter the display by editing attributes in
the Property Editor. Each calendar has two sets of editable attributes: Region
Attributes and Calendar Attributes.
About Dynamic Action Support for Calendar
o Dynamic actions provide a way to define complex client-side behaviour
declaratively without the need for JavaScript. Using the Dynamic Action
Create wizard, you specify an action that is performed when a defined set of
conditions occur. You can also specify which elements are affected by the
action, and when and how they are affected.
37
ORACLE APEX
Calendar is based on the FullCalendar jQuery library, and can only be customized
through CSS. Legacy Calendar is template-based and may be deprecated in the future
release.
Both Calendar and Legacy Calendar enable you to create a calendar based on a table
or SQL query you provide. During the creation process, you are prompted to select a date
column and display column. Because it offers a better user interface and numerous
additional features, Oracle recommends converting all legacy calendars to the latest
calendar.
Calendar
Rendering of duration and non-duration based events.
Ability to modify the start and end dates by dragging and dropping events on
different dates. Drag and drop is only supported for local data sources, that is,
database objects in the referenced database schema and not on external data sources
such as a Google calendar.
Ability to change the duration by resizing the length of the events, by changing the
end date.
Ability to Edit or Add new events on calendar using forms by clicking either on
events or empty calendar cell.
Rendering events from external sources using web service calls or Google Calendar
feeds.
Ability to render events titles on single or multiple lines.
Using different CSS classes, developer can choose different styles for different types
of events.
Ability to download events in PDF printable format.
Support of multiple formats for sharing events (iCal, CSV, XML).
Ability to add tooltip on Month/Week/Day views to make it easier for users to have
a quick look at details of each event.
38
APEX PAGE COMPONENTS
Legacy Calendar
Features of this calendar include:
Previous – Navigates to the previous month.
Next – Navigates to the next month.
Month – Displays a monthly view of all orders.
List – Displays a list of all orders.
39
ORACLE APEX
40
APEX PAGE COMPONENTS
41
ORACLE APEX
For Navigation Menu, specify the type of navigation to include on this page and
click Next. The navigation options that display depend upon the current
application theme.
For Data Source, select and then configure a remote database reference:
o For a REST Enabled SQL Service reference:
Data Source – Select REST Enabled SQL Service.
REST Enabled SQL Service – Select a REST Enabled SQL reference.
o For a Web source:
Location – Select Web Source.
Web Source Module – Select a Web Source Module.
For Source Type, do one of the following:
o If the Calendar source is a Table:
Source Type – Select Table.
Table/View Owner – Select the owner of the table on which you are
building a calendar.
Table/View Name – Select the table or view on which the calendar is
based.
Select Columns – Select one or more columns to be included in the
calendar.
Click Next.
o If the Calendar source is an SQL Query:
Source Type – Select SQL Query.
Enter Region Source – Enter the SQL SELECT statement to be used
for the calendar. The SQL SELECT statement must include at least
two columns, of which one must be a DATE column.
Click Next.
For Settings:
o Display Column – Select the column which holds the text displayed for
events on this calendar.
o Start Date Column – Select the column which holds the start date for events
displayed on this calendar.
42
APEX PAGE COMPONENTS
o End Date Column – Select the column which holds the end date for events
displayed on this calendar. If this attribute is specified, then the calendar
displays duration-based events.
o Show Time – Select the time portion of the date display.
o Click Create.
43
ORACLE APEX
44
APEX PAGE COMPONENTS
o Select an application.
o Select a page. Page Designer appears.
In the Rendering tab, locate and select the calendar. The Property Editor displays
the region attributes.
In the Rendering tab, locate the calendar and select the Attributes node. The
Property Editor displays the calendar attributes. Attributes are organized in groups.
To find a group or attribute:
o Search for the group or attribute – Enter keywords in the Filter Properties
field. The Property Editor displays the group or attributes. To return to the
default display, delete the keywords.
o Use Go to Group – Click Go to Group and select the group. To return to
the default display, click Go to Group again and select Expand All.
Edit the calendar attributes.
To save your changes click Save. To save and run the page, click Save and Run
Page.
45
ORACLE APEX
47
ORACLE APEX
Find Advanced.
For Initialization JavaScript Code, enter a JavaScript function to override the
standard jQuery FullCalendar initialization attributes.
Click Save.
48
APEX PAGE COMPONENTS
o For example, the following code changes the event row in the PROJECTS
table after the end user has dragged the event to a new date.
begin update projects set start_date =
to_date(:APEX$NEW_START_DATE, 'YYYYMMDDHH24MISS'),
end_date = to_date(:APEX$NEW_END_DATE, 'YYYYMMDDHH24MISS')
where id = :APEX$PK_VALUE; end;
o To learn more, click the Help tab in the central pane.
Click Save.
49
ORACLE APEX
Note: To view examples of this functionality, run the Sample Calendar sample application.
From the navigation menu, select the Calender and Dynamic Actions and select the
calendar event. See "Installing a Packaged Application."
Charts
Oracle JET (JavaScript Extension Toolkit) is a collection of open source JavaScript libraries
with a set of Oracle contributed JavaScript libraries which helps us to create Interactive
charts easily. We can create a chart by referring the below URL.
https://docs.oracle.com/en/database/oracle/application-express/19.1/htmdb/creating-
charts.html#GUID-010717AD-51E9-49A2-8026-1DD472260B45
50
APEX PAGE COMPONENTS
In this tutorial we are going to see how it is possible to dynamically change the chart
type in oracle apex.
In Oracle JET there are many types of charts you can create, but most used types
are:
Pie Chart
Line Chart
Donut Chart
Bar Chart
You can easily understand if you have a little knowledge in jQuery and JavaScript.
As a First Step, we are going to Create two different chart types with one select list on page:
Create static region and enter the region name as Dynamic Chart I/P.
Create a select list item in the name of P8_CHART_TYPE and choose list of value
type as sql query,
SELECT d, r
FROM (SELECT 'Pie' d,'pie' r, 1 seq
FROM DUAL
UNION
SELECT 'Donut' d, 'donut' r, 2 seq
FROM DUAL
UNION
SELECT 'Funnel' d, 'funnel' r, 3 seq
FROM DUAL
UNION
SELECT 'Pyramid' d, 'pyramid' r, 4 seq
FROM DUAL
UNION
SELECT 'Bar' d, 'bar' r, 5 seq
FROM DUAL
UNION
SELECT 'Area' d, 'area' r, 6 seq
FROM DUAL
UNION
SELECT 'Line' d, 'line' r, 7 seq
FROM DUAL
UNION
SELECT 'Linewitharea' d, 'lineWithArea' r, 8 seq
FROM DUAL)
51
ORACLE APEX
ORDER BY seq
Click Save.
Now we have created one chart.
Follow the below given steps to create one more chart,
Create a chart region and assign a Static ID as DYN_CHRT1.
Set Parent region as Dynamic Chart I/P.
Click on Region attributes and Select the chart type as Bar.
Place the code given below in the query source,
Select JOB, count(EMPNO) value
from EMP
where EMPNO is not null
group by JOB
order by 2 desc
Click Save.
Until now we have created two charts. Let us see how to add the Javascript part for
changing chart type dynamically.
Create a dynamic action as follows,
o Event : Change
o Selection Type : Items(s)
o Item(s) : P8_CHART_TYPE
o Action : Execute Javascript Code
o Fire on Initialization : Yes
52
APEX PAGE COMPONENTS
o Code :
var chrt = $('#P8_CHART_TYPE').val();
var chrt_typ1 = ["area", "bar", "line", "lineWithArea"];
var chrt_typ2 = ["funnel", "pie", "pyramid", "donut"];
if (chrt_typ1.indexOf(chrt) >= 0) {
$("#DYN_CHRT").hide();
$("#DYN_CHRT1").show();
apex.region('DYN_CHRT1').widget().ojChart({
styleDefaults: {
'threeDEffect': 'on'
}
});
apex.region('DYN_CHRT1').widget().ojChart({
type: chrt
});
} else if (chrt_typ2.indexOf(chrt) >= 0) {
$("#DYN_CHRT1").hide();
$("#DYN_CHRT").show();
apex.region('DYN_CHRT').widget().ojChart({
styleDefaults: {
'threeDEffect': 'on'
}
});
if (chrt == "pie") {
apex.region('DYN_CHRT').widget().ojChart({
type: chrt
});
apex.region("DYN_CHRT").widget().ojChart({
styleDefaults: {
pieInnerRadius: '0'
}
});
} else if (chrt == "donut") {
apex.region('DYN_CHRT').widget().ojChart({
type: "pie"
});
apex.region("DYN_CHRT").widget().ojChart({
styleDefaults: {
pieInnerRadius: '0.5'
}
});
} else {
apex.region('DYN_CHRT').widget().ojChart({
53
ORACLE APEX
type: chrt
});
}
} else {
$("#DYN_CHRT").hide();
$("#DYN_CHRT1").hide();
}
Click Save.
Run a Page and change the chart type dynamically
Below are the outputs of data in different Chart types. Based on the input Chart type.
Pie Chart:
Dynamic Chart
Chart Type
Pie
54
APEX PAGE COMPONENTS
Donut Chart:
Dynamic Chart
Chart Type
Donut
Funnel Chart:
Dynamic Chart
Chart Type
Funnel
55
ORACLE APEX
Classic Report
A classic report is the formatted result of an SQL query. Developers can control report
layout, pagination, column sorting, error messages, export links, and column break of
Classic reports.
To create a simple classic report on page:
Create a region and name as Classic Report and select type as Classic Report.
Select source type as SQL Query and place your code.
Sample code:
SELECT dname department, ename Name , job , sal Salary
FROM emp e, dept d
WHERE e.deptno = d.deptno
order by 1, 2
56
APEX PAGE COMPONENTS
57
ORACLE APEX
hdr_cnt = 1;
} else if ( int_val == cur_val ) {
hdr_cnt++;
$(this).remove();
}
});
if ( hdr_cnt!="" ){
$int_td.attr( "rowspan", hdr_cnt );
}
});
58
APEX PAGE COMPONENTS
Click Save.
Source: http://apexbyg.blogspot.com/2017/04/how-to-make-any-table-header-sticky.html
59
ORACLE APEX
Use the Column Toggle Report to let user quickly choose columns to display when
screen size is limited.
Choose Column Toggle Report as Region type.
Examples
Standard
Display a report where end users can select the columns to display at runtime. End
users can then change the columns based on the width and orientation of the screen
they are using to display the report.
No Stripes
60
APEX PAGE COMPONENTS
Display a report where end users can select the columns to display at runtime. End
users can then change the columns based on the width and orientation of the screen
they are using to display the report.
Forms
Form Regions enable user to load and submit the data that are linked to the table columns
from a single table. We shall discuss below the form creation methods, the recent updates
in form region in Oracle APEX 19.1.
In prior versions of APEX, it will be limited to a single DML load process and a single DML
submit process, and all the items on the page that were linked to a table column were
required to be from only a single table.
The new components/attributes for Form Regions are:
61
ORACLE APEX
In Form Region type, the source tables are defined in three different methods like
Local Database, Rest Enabled SQL Service and Web Source.
Item Source attribute must be defined with particular form Region, Query Only and
Primary Key options we can set as “Yes/No” based on the requirement.
Form Initialization and Automatic Row Processing (DML) that is associated with
Form region helps us to change the form target region (default is the source table)
to a different table or view, or to replace the DML processing with your custom
PL/SQL
Source: https://jeffkemponoracle.com/2019/04/form-regions-superclass-subclass/
Form Creation
In the Create Page wizard, click Form and the Next button.
62
APEX PAGE COMPONENTS
Click the “Form” option and click next button. Then click “Report with form”
option and “Next” Button.
Create a Report as Interactive Report type and select the form Page Mode as
“Normal”.
If you want modal Dialog, then select the Page Mode as “Modal Dialog”.
63
ORACLE APEX
Data Source
You can provide data source in three different types.
Local Database
Rest Enabled SQL Service
Web Source
Now we will focus on Local Database. Under Local Database we have “Source type”
option. There are two source types
Table
SQL Query
If the Choice is “Table”, then you can choose the table from the list view directly.
If it’s an “SQL Query” then you can give associated query to create a report.
64
APEX PAGE COMPONENTS
Form Region
Form – Initialization and Automatic Row Processing (DML) is automatically created under
process section on Before Header by default it’s under source table.
65
ORACLE APEX
66
APEX PAGE COMPONENTS
We can also edit the department details and click the “Apply changes” to update the
information.
Help Text
Application Builder includes built-in attributes to create Help for your application.
Creating Help for your application involves the following steps:
Create a dedicated Help page and Help region.
Define page Help text.
Define item Help text.
Create a navigation bar icon to link to your Help page.
Help created in Application Builder displays on a dedicated Help page. To access Help,
users click a link that takes them to a dedicated Help page. This Help page displays page
and item Help topics specific to the page they are viewing.
Topics in this section include:
Creating a Help Page and Region
Defining Help Text
Creating a Help Navigation Bar Entry
Creating a Help Page and Region
The first step in creating Help for your application is to create a dedicated page and Help
Text region. To create a Help Text region:
Create a page for your Help.
Navigate to the Page Definition of your Help page.
Under Regions, select the Create icon.
When prompted to select a region type, select Help Text.
67
ORACLE APEX
68
APEX PAGE COMPONENTS
69
ORACLE APEX
Interactive Grid
Interactive grid is a most awaited functionality of oracle apex which combines forms and
interactive reports which enable user to not only view the data but also have the privilege of
editing the same, and the edited data will be saved to the database. This acts more like an
excel sheet where the user can view and save the data further to this, can the modify the
view as per needs like charts, or group the data based on some criteria, or even perform
arithmetic operation for the data and showcase to the end users. The following image is the
typical interactive grid where user can add, edit and save data.
There are different options like adding duplicate row as above, delete and refresh
row, where the refresh row plays an important role. This enables user to refresh the latest
values from the table, as we know if a user is editing a row in Oracle, in turn it locks the
particular row, and releases the lock once commit for the change is done. In Doyensys we
had a requirement to cascade the select list in the columns of the interactive grid which was
not an inbuilt feature.
Step 1: Create an editable Interactive Grid with two dummy columns. Set static id of the
region as ‘orderdtls’
E.g.:
SELECT
order_id,
customer_id,
order_total,
71
ORACLE APEX
order_timestamp,
user_name,
tags,
'N'||order_id checkbox, --dummy column for checkbox
'N' status --dummy column updating status
FROM
demo_orders
apex.jQuery(function() {
apex.item.create("CHECKBOX", {
displayValueFor: function(value) {
var ord_id = value.substr(1);
var status = value.substr(0,1);
72
APEX PAGE COMPONENTS
var model =
apex.region('orderdtls').widget().interactiveGrid("getViews","grid").mode
l;
model.forEach(function( object,r )
{
ord_no = model.getValue(object,"ORDER_ID");
colstatus = model.getValue(object,"STATUS");
if (ord_no == ord_id)
{
if ( colstatus == 'Y' )
{
cb_val = 'Y';
}
else if ( colstatus == 'N' )
{
cb_val = 'N';
}}});
model.forEach(function( object,r )
{
var id = model.getRecordId(object);
ord_id = model.getValue(object,"ORDER_ID");
73
ORACLE APEX
if ( req_no == ord_id)
{
status = model.getValue(object,"STATUS");
if( status.substr(0,1) == 'Y')
{
model.setValue(object,"STATUS",'N');
$(cb_id).removeClass('fa-check-square-
o').addClass('fa-square-o');
}
else if( status.substr(0,1) == 'N')
{
model.setValue(object,"STATUS",'Y');
$(cb_id).removeClass('fa-square-o').addClass('fa-
check-square-o');
}}});}
74
APEX PAGE COMPONENTS
(function($) {
$(function() {
$('#orderdtls').on("interactivegridreportsettingschange",
function(event, ui)
{
var status = $('#selectall').attr('value');
if (status == 'Y')
{cb_selectall(); }
});
});
})(apex.jQuery);
Screenshot
On load Grid with Unchecked Check Box
Multiple selection Check Box and capturing the values in the Status column
75
ORACLE APEX
Thus, multiple selection of records can be done and Select All option is available for
selecting all the records in all the pagination sets.
Note: If the status column should be hidden, remove the column from report action menu.
Do not make the column hidden in the page setting.
Interactive Report
By default the Interactive Reporting Region allows end users to customize reports. This
interactive reporting region allows users to customize the layout of the data by choosing the
columns they are interested in, applying filters, highlighting, and sorting. They can also
define breaks, aggregations, different charts, and their own computations.
Upon the default functionality, the Apex developer can also customize the Interactive
Report. Let’s see two Samples.
Cascading Select list in IR
Enable/Disable Download button based on User Role
76
APEX PAGE COMPONENTS
77
ORACLE APEX
78
APEX PAGE COMPONENTS
Step 4: Set Escape special characters as No for the following Columns CHKBX, DNAME,
ENAME, SAL
79
ORACLE APEX
Step 6: Place the below javascript code in the Function and Global Variable Declaration
section of Page header
function f_set_casc_sel_list_item(a, b) {
var p_deptno = $(a).val();
apex.server.process('GET_EMP_FR_DEPT', {
x01: p_deptno
}, {
success: function(pData) { //alert(pData);
var ret = pData;
$('#' + b).children('option:not(:first)').remove();
if (ret) {
$("#" + b).append(ret);
}
},
dataType: "text"
});
}
80
APEX PAGE COMPONENTS
Step 7: Create an Ajax call back application level process and enter the process name as
GET_EMP_FR_DEPT and place the code given below,
Shared Components ==> Application Process
BEGIN
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
END;
81
ORACLE APEX
82
APEX PAGE COMPONENTS
83
ORACLE APEX
Step 10: Finally screen design will look like the below image and now you can see the
Editable IR report with cascading select list and do the changes and store the changes in the
database.
84
APEX PAGE COMPONENTS
RETURN FALSE;
END IF;
END;
Step 4: Screen looks like below image when Admin user logs into the application.
86
APEX PAGE COMPONENTS
Steps 5: Screen looks like below image when Support user logs into the application.
List
A list template provides a collection of links which can be used for navigation and other
action-oriented tasks. You can optionally show badges, icons, sub list items, and more. A
list will be available under Navigation region on the Shared Components, and it can be
crated globally and associated with any of the pages within the application. The appearance
of the list display in the page is based on the list templates. Each list can be controlled by
adding a display condition to it. Let’s see how to create a list,
Two types of lists can be created in Oracle Application Express:
Static Lists
Dynamic Lists
Static Lists
A Static List is based on predefined display and return values. When you wish to create a
static list, a list entry label and a target (either a page or URL) attributes need to be defined.
A static list can be created using the following option, creating from scratch, by copying
87
ORACLE APEX
existing entries, or by adding the list entries. Each list will have display condition, which
enables to control its display.
The following describes how to create a Static List:
Navigate to the application shared components.
Create the list using the Create List Wizard.
Mention whether to create the list from scratch or by copying an existing list.
If the option from scratch is chosen, then enter the details for the Name, Select type
as Static and click next.
Define list entries and click next.
Specify the details for the following and click Create list.
o Create List regions
o Region Position
o Region Template
o List template
Create a region on a page and change the region type to List.
Navigate to source and click on the drop down of the list. You can view the
collections of lists that are created on the shared component.
Choose any of the ones in the drop down.
Navigate to Appearance section available on the list attribute.
If you see in the List template, by default links list will be selected. But we can also
change the template by choosing any of the below,
o Badge list
o Cards
o Links List
o Media List
o Menu Bar
o Menu Pop up
o Navigation Bar
o Side Navigation Menu
o Tabs
o Top Navigation Menu
88
APEX PAGE COMPONENTS
89
ORACLE APEX
o Navigation Bar
o Side Navigation Menu
o Tabs
o Top Navigation Menu
o Top Navigation Tabs
o Wizard Progress
List View
List view is optimized for data display and smart phone navigation. List view on a page
contains the formatted result of an SQL query. You provide a custom SQL SELECT
statement or a return SQL Query PL / SQL function.
Create a simple list view report on a page by the following steps,
Create a page in the application.
Navigate to the created page and create a region using tree view / component view.
Select region type as List view.
Navigate to Source section and select the source type as Table/ View, SQL Query or
PL/SQL Function Body returning SQL query. I have chosen SQL Query.
Place the following code, SELECT * FROM DEPT
Navigate to setting attribute which is available in the region attributes.
Select the column value for Text Column.(Here DNAME was selected.)
Click Save and Run a Page.
The report looks like the below image. It will display the value based on the selection
done in the Text column.
90
APEX PAGE COMPONENTS
Oracle Apex allows us to make more informative list view by adding simple HTML
code. Let’s see the example of creating an informative list and based on the value selected in
the list, the classic report should get refreshed and display the result. Follow the steps given
below,
Create a Region using tree view/component view.
Change the region type to List View.
Select the source type as Table/View and choose DEPT table.
Navigate to setting attribute available in the list attribute and choose “Advanced
Formatting”.
Add the below piece of code in the Text Formatting,
<div id="&DEPTNO." class="cList-dept">
<h4>&DNAME.</h4>
<span>&LOC.</span>
</div>
Go to page header and navigate to the inline section and place the
code given below,
.cSelected{
background-color:#0076df;
color : white
;}
.cList-dept{
cursor:pointer;
}
91
ORACLE APEX
o True Action 2
Action : Execute Javascript code
PL/SQLCode : Begin Null; End;
Items to Submit : P23_DEPT(Hidden field)
o True Action 3
Action : Refresh
Selection Type : Region
Region : EMP(Classic Report)
Click Save and Run a page.
The Final screen will look like an image as shown below. Here in this example the
Department Research is selected in the list view and the classic EMP displays the employee
data for the selected department.
92
APEX PAGE COMPONENTS
Source : https://krutten.blogspot.com/2018/06/46-list-view-in-apex-181.html
Map Chart
A chart is a graphical representation of data, in which the data is represented by symbols,
such as bars in a bar chart, lines in a line chart, or slices in a Pie chart.
A chart can also represent tabular numeric data, functions, or some kinds of qualitative
structure, and provides different information.
On the Workspace home page, click the App Builder icon.
Select an application.
Click Create Page.
Click Chart.
Select Map Chart.
For Map Type, select United States of America and click next.
For Map Source, expand Country Maps and select States.
Image Reference: Oracle Docs
o For Page Attributes specify the appropriate attributes and click Next.
For Navigation Preference, specify the type of navigation to include on this page
and click Next. The navigation options (for example, navigation menu or tabs)
depends upon the current application theme.
For Map Attributes, select the appropriate attributes and click Next.
The Query page appears.
93
ORACLE APEX
Scroll down and expand and review the Map Query Example and Map Reference
Information regions.
Scroll down and expand and review the Map Reference Information region at the
bottom of the page.
Image Reference: Oracle Docs
94
APEX PAGE COMPONENTS
Sample Query
SELECT null link, region label, value Populations
FROM (
SELECT 'Florida' region, 18328340 value FROM dual
UNION ALL
SELECT 'Alaska' region, 686293 value FROM dual)
95
ORACLE APEX
Clicking the Build Query button. When the Build Chart Query Wizard appears,
follow the on-screen instructions and click create.
Map Chart in Page Designer
On the Workspace home page, click the App Builder icon.
Select an application.
Select a page.
Title - Enter a title for the region.
Layout
Sequence - Enter the display sequence for this item.
Parent Region - Select the parent region to which this region belongs.
Position - Select the template position used to display this region.
Appearance
Template - Select a region template.
Item Display Position - Specify where page items display in relation to the main
region content.
Layout - Specify the Sequence, Parent Region, and Position.
Appearance - Specify the template. In the Rendering tab, under the map chart title,
select the Attributes node.
Map, Level 1 - Select the map level from the available list (for example Europe).
Map, Level 2 - Select the map level from the available list (for example, Denmark).
Source, SQL Query - Enter the SQL Query for the chart series and click save.
Custom XML with Map Charts
View the page in Page Designer.
On the Workspace home page, click the App Builder icon.
Select an application.
Select a page.
Page Designer appears.
In the Rendering tab, under the region title, select the Attributes node.
The map chart attributes display in the Property Editor.
96
APEX PAGE COMPONENTS
97
ORACLE APEX
98
APEX PAGE COMPONENTS
99
ORACLE APEX
100
APEX PAGE COMPONENTS
Sample Query
DECLARE
CURSOR c1 IS
SELECT ename,
job
FROM emp
ORDER BY 1 ASC;
BEGIN
htp.P('<ul>');
FOR a IN c1 LOOP
htp.P('<li>'
|| a.ename
|| ' ('
|| a.job
|| ')</li>');
END LOOP;
htp.P('</ul>');
END;
Result
Reflow Report
The Reflow Report is a responsive table-based report where on small screens and also the
table columns become stacked and each row becomes a block of data
It is an alternative display to the Column Toggle Report and will also be useful
when you want to display all columns of a tabular report in a way that works well for small
screens.
101
ORACLE APEX
Step 2: Select the table or Enter the sql query in the Code editor
Sample Query
SELECT empno, ename, job, mgr,hiredate, sal
FROM emp
ORDER BY 1 ASC;
Result
With Stripes
102
APEX PAGE COMPONENTS
Without Stripes
103
ORACLE APEX
Scroll Window
It always displays all the regions on the page. Selecting a tab will scroll your window to the
corresponding region.
Step 1: Create a Region Display Selector region and place it in the Breadcrumb region
position on your page.
Step 2: Modify the other regions on the page and set the Region Display Selector property
to Yes for the regions you want to appear in the Region Display Selector.
Result
You can easily nest tabs by creating another Tabs Container region within a sub
region of an existing Tabs Container region.
104
APEX PAGE COMPONENTS
Static Content
Static Content is like a plain canvas. It is up to the developer to decide what he/she has to
do with the region. In majority of the cases it is used to display some html or static text like
notes, or instructions to the end users can be displayed here.
In Doyensys we have come across the requirement where one of our customers
asked for dynamic html table with mergeable text area. We have achieved this with static
content region
We have done the following changes to fulfil the above requirement. We have
written HTML in the static content, we have coded the following in the static content
<style>
.t-Report-colHead
{ background-color:#128475;
color: #FFFFFF;}
</style>
<table id="myhtml" class="t-Report-report" style="width:100%">
<tr>
<th class="t-Report-colHead" style="border-left: 1px solid
#00433c" id="EDIT">Edit</th>
<th class="t-Report-colHead hiddenth" id="RISK_ID" style="width:
65px;">Risk<br>ID</th>
<th class="t-Report-colHead" id="RISK_ORD" style="width:
65px">Risk<br>Display<br>Order</th>
105
ORACLE APEX
106
APEX PAGE COMPONENTS
107
ORACLE APEX
$('#myhtml').append(row);
$("#imp_" + rownum).val(impact);
$("#tol_" + rownum).val(tol);
max_row = rownum;
}
function add_error(addrow) {
var first_rw_no = $(curr_td_element).parents('tr').index();
var cond = validation('adderror');
if (cond) {
var rowspan = $(curr_td_element).prop("rowspan");
var row_num = $(addrow).parents('tr').index();
var row_id = $(addrow).parents('tr').prop('id');
$('#ADD_ERROR').remove();
108
APEX PAGE COMPONENTS
max_row += 1;
var new_error = "<tr id=row_" + max_row + ">" +
"<td class='myhtmltd current' id='f11_" + max_row + "'
headers='ERR_ORD'><select class='apex-item-select errord' id=err_ord_" +
max_row + "></select></td>" +
"<td class='myhtmltd' id='f12_" + max_row + "'
headers='ERR_ORD_HID' style='display: none'><input type='text'
id=err_ord_hid" + max_row + "></td>" +
"<td class='myhtmltd current' id='f04_" + max_row + "'
headers='ERROR_DESC'><textarea class='myhtmlitem text apex-item-textarea'
maxlength='200' type='text' class='text_field apex-item-
text'></textarea>" + add_error + "</td>" +
"<td class='myhtmltd current' id='f06_" + max_row + "'
headers='IMPACT'><select onchange='impchg(this)' class='myhtmlitem apex-
item-select' id=imp_" + max_row + ">" + imp_options + "</select></td>" +
"<td class='myhtmltd current' id='f07_" + max_row + "'
headers='TOL'><select onchange='tolchg(this)' class='myhtmlitem apex-
item-select' id=tol_" + max_row + ">" + tol_options + "</select></td>" +
"<td id='f08_" + max_row + "' headers='ERR_DEL'
onclick='del(this,2)'><img src='#APP_IMAGES#delete_icon.jpg'></td>" +
"</tr>";
$('#' + row_id).after(new_error);
function addrisk() {
var cond = validation('addrisk');
if (cond) {
$('.myhtmlitem').prop('disabled', 'true');
$('.myhtmlitem').addClass('disable');
$('#ADD_ERROR').remove();
var last_row_index = $('#myhtml tr:last').index();
109
ORACLE APEX
max_row += 1;
var imp_options = "<option value=''>--Select--</option><option
value='LOW'>LOW</option><option value='MEDIUM'>MEDIUM</option><option
value='HIGH'>HIGH</option>";
var tol_options = "<option value=''>--Select--</option><option
value='0'>None</option><option value='1'>1 Error</option><option
value='2'>2 Errors</option><option value='3'>3 Errors</option><option
value='4'>4 Errors</option><option value='5'>5 Errors</option><option
value='6'>6 Errors</option><option value='7'>7 Errors</option><option
value='8'>8 Errors</option><option value='9'>9 Errors</option><option
value='10'>10 Errors</option>";
var editfunc = 'edit(this)';
var add_error = '<div><br><input type="button" class="adderror"
id="ADD_ERROR" onclick="add_error(this)" value="Add Error Type"></div>';
var err_options = "<option value='1'>1</option>";
110
APEX PAGE COMPONENTS
111
ORACLE APEX
rowspan = 1;
}
for (i = 1; i <= rowspan; i++) {
var rownum = parseInt(first_rw + i);
$('#myhtml > tbody > tr:nth-child(' + rownum + ')
> td ').each(function() {
$(this).remove();
});
}
add_del_risk_ord('del', 0, row_ord);
//to remove empty tr (above del function removes only
td)
$('#myhtml').find('tr').each(function() {
var len = $(this).html().length;
if (len == 0) {
$(this).remove();
}
});
},
No: function() {}
}
});
} else {
$.confirm({
boxWidth: '30%',
useBootstrap: false,
title: 'Confirm!',
type: 'orange',
content: 'Confirm Error Type Deletion',
buttons: {
Yes: function() {
var first_rw = $(element).parents('tr').index();
var rowid = $(element).parents('tr').attr('id');
var status = false;
var rowspan;
var row_ord = $("#risk_ord_" + first_rw).val();
$('#myhtml > tbody > tr:nth-child(' +
parseInt(first_rw + 1) + ') > td').each(function() {
var header = $(this).attr("headers");
if ((header == 'RISK_DESC') || (header ==
'RISK_ORD')) {
status = true;
rowspan = $(this).prop("rowspan");
if (rowspan == undefined) {
rowspan = 1;
112
APEX PAGE COMPONENTS
}
}
});
if (status) {
if (rowspan == 1) {
//for only one error type, risk must be
removed
$(element).parents('tr').remove();
add_del_risk_ord('del', 0, row_ord);
} else {
//for first error type of a risk, risk must
be removed and merged with other error type
var element1;
var element2;
var element3;
var element4;
var element5;
113
ORACLE APEX
114
APEX PAGE COMPONENTS
} else if ($(this).attr("headers") ==
'RISK_DESC') {
id2 = $(this).prop('id');
rowspan2 =
$(this).prop('rowspan');
} else if ($(this).attr("headers") ==
'CF_RISK') {
id3 = $(this).prop('id');
rowspan3 =
$(this).prop('rowspan');
} else if ($(this).attr("headers") ==
'RISK_ORD') {
id4 = $(this).prop('id');
rowspan4 =
$(this).prop('rowspan');
} else if ($(this).attr("headers") ==
'RISK_ID') {
id5 = $(this).prop('id');
rowspan5 =
$(this).prop('rowspan');
}
} else {
loopcond = false;
}
}
});
$('#' + rowid).remove();
$('#' + id1).prop('rowspan', rowspan1 - 1);
$('#' + id2).prop('rowspan', rowspan2 - 1);
$('#' + id3).prop('rowspan', rowspan3 - 1);
$('#' + id4).prop('rowspan', rowspan4 - 1);
$('#' + id5).prop('rowspan', rowspan5 - 1);
115
ORACLE APEX
if (stat == 'new') {
cond = true;
} else {
cond = validation('edit');
}
if (cond) {
//disabling all items and insert error row excpt err and risk ord
$('.myhtmlitem').prop('disabled', 'true');
$('.myhtmlitem').addClass('disable');
$('.myhtmlitem,.riskord,.errord').parents('td').removeClass('current');
$('.edit').removeClass('current');
$('#ADD_ERROR').remove();
curr_td_element = $(element).parents('td');
var first_rw_no = $(curr_td_element).parents('tr').index();
var rowspan = $(curr_td_element).prop("rowspan");
if (rowspan == undefined) {
rowspan = 1;
}
var curr_row = first_rw_no + rowspan;
//enabling the edit row items
for (i = 0; i < rowspan; i++) {
var rownum = parseInt(first_rw_no + i + 1);
116
APEX PAGE COMPONENTS
if ($(this).parents('td').attr('headers') == "TOL") {
if ($(this).val() == '0') {
$(this).prop('disabled', 'true');
}
}
//ends here
});
}
//add error type link
var j = 1;
}
j++;
});
}
}
function merge() {
$(document).ready(function() {
$('#myhtml').each(function() {
var risk_id = null;
var edit_rsk, cf_risk, risk_seq, risk_desc, i = 1;
117
ORACLE APEX
}
i++;
});
risk_id_td.text("");
var v_first_instance = 0;
118
APEX PAGE COMPONENTS
if (isNaN(first_instance.attr('rowspan'))) {
v_first_instance = 1;
} else {
v_first_instance =
first_instance.attr('rowspan');
}
119
ORACLE APEX
} else {
val += 'N';
}
}
if ($(this).prop('headers') == 'ERROR_DESC') {
val += $(this).find('textarea').val();
}
if ($(this).prop('headers') == 'IMPACT') {
val += $(this).find('select').val();
}
if ($(this).prop('headers') == 'TOL') {
val += $(this).find('select').val();
}
});
return val;
}
var initval = getval();
120
APEX PAGE COMPONENTS
This is the best learning we have ever had. In the beginning when we had the layout
as requirement, we had decided it is not possible in Oracle Apex to design the layout. So we
had given suggestions for the work, but later we have done tons of research and
development to achieve this. So nothing is impossible in Oracle Apex.
Tree
Tree is the Oracle apex item which creates the hierarchical view from apex version 5.0.
Oracle introduced new features which help in javascript based, cross browser component
with optional keyboard navigation. This is the same as jstree .You can create tree from a
query based on a hierarchical relationship identified by id and parent id in the column
using start with .. connect by clause
A tree can be created based on a query and returns data that can be represented in a
hierarchical manner. When you create an inbuilt tree component using the Create Page
Wizard, it generates this hierarchical query for you based on the options you select.
To create a tree on a new page:
Click the Application Builder icon located in Workspace home page.
Select an application.
Click Create Page.
For Create a Page:
o Select Desktop as User Interface.
o Select a page type - Select Tree.
o Click Next.
For Page Attributes, specify the following:
o Enter Page Number.
o Enter Page Name.
o Select a page mode.
o Select a region template for the tree region.
o Enter a name for the region to contain the tree.
o Click Next.
121
ORACLE APEX
For Navigation Preference, specify the type of navigation to include on this page
and click Next. The navigation options (for example, navigation menu or tabs)
depends upon the current application theme.
For Table/View Owner and Name:
o Table/View Owner - Select the owner of the table from which the tree will
be based.
o Table / View Name - Select the table or view which contains the columns to
be included in the master page.
o Click Next.
For Query, identify the column you want to use as the ID, the Parent ID, and text
that should appear on the nodes:
o ID - Select the column to use as the ID.
o Parent ID - Select the column to use as the parent ID.
o Node Text - Select the text to appear on the tree nodes.
o Start With - Select the column to be used to specify the root of the
hierarchical tree query.
o Start Tree - Choose how to start your query. Options include:
Based on Existing Item - Select an existing application or page item.
Based on an SQL Query - Enter an SQL query that returns a single
row or single column.
Based on a Static Value - Enter a static value.
Value is NULL.
o Click Next.
For Where and Order by, specify the following:
o Where Clause - Enter an optional WHERE clause. For example:
o ename='JONE'
o Order Siblings By - Select the order siblings by column, such as ENAME.
The default value is based on the Node Text column selected.
o Click Next.
For Tree Attributes, specify the following:
o Include Buttons - Select the buttons to include.
122
APEX PAGE COMPONENTS
o Selected Node Page Item - Select the page or application item to hold the
selected node value. This item can be used to save the tree state, by holding
the value of the last selected node. The value of the selected node can be
saved to the selected item using the node link attribute or a page process.
When the tree is reloaded, the tree opens to the last selected tree node.
o Tooltip - Displays a tooltip when the mouse hovers over a leaf node.
Options include:
Static Assignment - Specifies a static value to be used as the tooltip
text. Substitution strings can be used in the static text, to incorporate
information from the SQL query in the tooltip text. The following
substitution strings can be used:
#VALUE# - refers to the value of ID column.
#TITLE# - refers to the value of Node Text column
#LINK# - refers to the value of Link option
Database Column - Select the column to use as the tooltip text.
o Link Option:
Existing Application Item - Makes the leaf node text a link. If you
select this option, you must specify a page to link to and an existing
application item to link leaf node text. This option only appears if
you select the Existing Application Item link option.
Nothing
o Click Next.
Confirm your selections and click Create.
So far we have seen how to create the default tree, but we as a developer need some
extra touch which we can bring from the javascript .combine check box to tree and make
the tree editable.
Step 1: create tree region with the following script
SELECT CASE
WHEN CONNECT_BY_ISLEAF = 1
THEN 0
WHEN LEVEL = 1
THEN 1
123
ORACLE APEX
ELSE -1
END AS status,
LEVEL, entry_text AS title, NULL AS icon,
list_entry_id AS VALUE, entry_text AS tooltip, NULL AS LINK
FROM apex_application_list_entries
WHERE application_id = :app_id and list_entry_id not in (SELECT
list_entry_parent_id
FROM (SELECT list_entry_parent_id, COUNT (list_entry_id)
FROM apex_application_list_entries
WHERE list_entry_parent_id IN (
SELECT list_entry_parent_id
FROM (SELECT list_entry_parent_id, COUNT
(report_id)
FROM doy_tb_report_configuration d,
apex_application_list_entries a
WHERE d.report_id = a.list_entry_id
AND report_configuration !=
:p81_report_config
GROUP BY list_entry_parent_id))
GROUP BY list_entry_parent_id
INTERSECT
SELECT list_entry_parent_id, COUNT (report_id)
FROM doy_tb_report_configuration d,
apex_application_list_entries a
WHERE d.report_id = a.list_entry_id
AND report_configuration != :p81_report_config
GROUP BY list_entry_parent_id)
UNION
SELECT report_id
FROM doy_tb_report_configuration
WHERE report_configuration != :p81_report_config)
START WITH PARENT_ENTRY_TEXT ='Reports'
CONNECT BY PRIOR list_entry_id = list_entry_parent_id
ORDER SIBLINGS BY list_id;
124
APEX PAGE COMPONENTS
$this.find("li").andSelf().children("a").removeClass("checked").removeCla
ss("undetermined").addClass("unchecked");
var state = 0;
} else {
$this.find("li").andSelf().children("a").removeClass("unchecked").removeC
lass("undetermined").addClass("checked");
var state = 1;
}
$this.parents("li").each(function() {
if (state == 1) {
if ($(this).find("a.unchecked,
a.undetermined").size() - 1 > 0) {
$(this).parents("li").andSelf().children("a").removeClass("unchecked").re
moveClass("checked").addClass("undetermined");
return false;
} else
$(this).children("a").removeClass("unchecked").removeClass("undetermined"
).addClass("checked");
} else {
if ($(this).find("a.checked,
a.undetermined").size() - 1 > 0) {
$(this).parents("li").andSelf().children("a").removeClass("unchecked").re
moveClass("checked").addClass("undetermined");
return false;
} else
$(this).children("a").removeClass("checked").removeClass("undetermined").
addClass("unchecked");
}});}},
onopen: function(NODE, TREE_OBJ) {
$(NODE).removeClass("open").addClass("closed");
},
onclose: function(NODE, TREE_OBJ) {
$(NODE).removeClass("closed").addClass("open");
125
ORACLE APEX
}}});
document.getElementById("tree373743011093796525").onclick = function() {
clickFunction()
};
function clickFunction() {
var lPassengers = [];
$(".leaf a.checked").parent()
.each(function() {
lPassengers.push($(this).attr("id"))
});
$s("P81_LIST_ID", lPassengers.join(":"));
}
$(document).ready(function() {
$.each($v("P81_LIST_ID").split(":"),
function(intIndex, objValue) {
$("li#" + objValue + ".leaf a:first-child").click();
});});
https://docs.oracle.com/html/E39147_04/tree_query.htm
126
APEX PAGE COMPONENTS
ITEMS
Checkbox
Creating checkbox is relatively easy. By default the Oracle Apex allows to create a simple
checkbox in the HTML region. The HTML region types are used for forms in Oracle Apex.
Let’s see how to create a simple checkbox in Form/HTML region.
Step 1: Create a static content region type.
Step 2: Create an Item either using Tree view/ Component view.
Step 3: Change the type from Text to Checkbox.
Step 4: Go to List of Values by scrolling down from right pane.
Step 5: Based on the requirement select the LOV type.
Step 6: Click Save and Run a page.
Finally, the checkbox will be seen in the page.
Now let’s see how to do the customization.
Adding Checkbox column in Report
127
ORACLE APEX
Let's imagine you have an IR report where you want to add a checkbox column. Let’s see
how to do this in detail.
Step 1: In a Page, Create a Region and select report type as Interactive report
Step 2: Change the source type from Table/View to SQL Query
128
APEX PAGE COMPONENTS
Step 4: Set Column Type as Plain Text and Escape special characters as No for the following
Column CHK
..
129
ORACLE APEX
Display Image
The display image item is nothing but it will enable the display of images stored in an
image URL stored in another page item or in a BLOB column. The user is also able to alter
where the image is stored, edit the item and configure it based on attribute.
It consists of some setting attributes below as
Based On
This option helps to determines where the item is retrieved from.
Alternative Text Column
This option helps if the user specified it, then the returned text is used as an alternative text
for the image.
Filename Column
If the user specified this option, the returned file name is used by the browser in the Save
As dialog when the user tries to saves the image.
BLOB Last Updated Column
If the user selects this option, the column is used for browser caching. It identifies if the
image changed since the last browser request. If not entered, no caching is done.
Note: This attribute is case sensitive and the column must be of type DATE.
Step 1: Create an Item and select the type as Display Image.
Image URL stored in Page Item Value
This option helps to get the value of image stored in the session state of the page item.
BLOB Column specified in Item Source
This options will read image from the blob column as specified in item source.
130
APEX PAGE COMPONENTS
We can use the BLOB columns when working with images coming from the
database, but here you can just use the "Image URL" option.
All you need to do then is to specify the URL in the item's source.
131
ORACLE APEX
Sample Syntax
<img src="#APP_IMAGES#flow.png" alt="image">
Result
File Browse
The File Browse item will display a text field with the option of browse Button. This enables
the user to locate and upload a file from a local file system.
It consists of some setting features as below.
Value Required
This option helps the user as if Yes is selected and the page item is visible, Oracle
Application Express automatically performs a NOT NULL validation when the page is
submitted.
132
APEX PAGE COMPONENTS
Storage Type
It helps to Identify where the uploaded file is stored.
MIME Type Column
This option helps to specify the name of the column where the MIME type of the uploaded
file should be stored.
Filename Column
This option helps to specify the name of the column where the file name of the uploaded
file should be stored.
Character Set Column
This option helps to specify the name of the column where the character set of the
uploaded file should be stored.
BLOB Last Updated Column
If the user specifies the name of the column to update with the current time stamp when a
file gets uploaded.
Display Download Link
This option helps the user if Select Yes to display the download link next to the Browse
button.
Download Link Text
It will display text used for the download link to download the files.
Content Disposition
This option helps to determines if the downloaded content is displayed in line within the
Browser window or if an Open dialog displays.
Step 1: Create a page item and set type as “File Browse”.
Step 2: In Settings Option, Select the Storage Type as
TABLE_APEX_APPLICATION_FILES.
133
ORACLE APEX
l_clob CLOB;
l_dest_offsset INTEGER := 1;
l_src_offsset INTEGER := 1;
134
APEX PAGE COMPONENTS
RETURN l_clob;
END PDD_clobfromblob;
/
Step 5: Create the type & Object by using the below Query
CREATE OR REPLACE TYPE "PDD_BURSTING_OBJECT_TYPE" IS OBJECT (
batch_number VARCHAR2(100), test_name
VARCHAR2(100),
test_sequence VARCHAR2(100), test_value
VARCHAR2(100),
actual_result_date VARCHAR2(100), equipment_info
VARCHAR2(100),
tester VARCHAR2(100), inspector
VARCHAR2(100),
product VARCHAR2(100), bin_number
VARCHAR2(100),
inspection_type VARCHAR2(100), flag
VARCHAR2(100)
);
CREATE OR REPLACE TYPE "PDD_BURSTING_TABLE_TYPE" AS
TABLE OF PDD_bursting_object_type
136
APEX PAGE COMPONENTS
137
ORACLE APEX
Sample Code
Process 1
DECLARE
V_HISID NUMBER;
CURSOR cur_upload IS
SELECT id, name, filename, mime_type, blob_content
FROM apex_application_temp_files
WHERE name =:P28_FILE_BROWSE;
BEGIN
FOR i IN cur_upload LOOP
SELECT (NVL(MAX(HIS_ID),0)+1) HIS_ID
INTO V_HISID FROM PDD_BURTSING_FILES_HIS_TBL;
INSERT INTO PDD_BURTSING_FILES_HIS_TBL
SELECT V_HISID,A.* FROM PDD_burtsing_files_tbl A
where upper(file_name)=upper(i.filename);
delete from PDD_burtsing_files_tbl
where upper(file_name)=upper(i.filename);
INSERT INTO PDD_burtsing_files_tbl (
file_id,
file_name,
mime_type,
blob_content,
created_by,
created_date,
status
) VALUES (
i.id,
upper(i.filename),
i.mime_type,
i.blob_content,
:app_user,
SYSDATE,
'STAGING'
);
END LOOP;
END;
Process 2
DECLARE
v_bursting_id NUMBER;
v_fileid NUMBER;
v_file_name VARCHAR2(200);
138
APEX PAGE COMPONENTS
CURSOR cur_stg_file IS
SELECT DISTINCT file_id, file_name
FROM PDD_burtsing_files_tbl
WHERE status = 'STAGING';
CURSOR cur_loaded_data (
p_filename VARCHAR2
) IS SELECT a.*
FROM TABLE ( PDD_bursting_extract_csv(p_filename,'UPLOAD') ) a
WHERE upper(batch_number) <> 'BATCH_NUMBER';
BEGIN
BEGIN
FOR i IN cur_stg_file LOOP
DELETE FROM PDD_bursting_stg_tbl
WHERE
upper(file_name) = upper(i.file_name)
AND status IN ( 'STAGING','FAILED');
v_fileid := i.file_id;
v_file_name := i.file_name;
INSERT INTO PDD_bursting_stg_tbl (
bursting_id, file_id,
file_name, batch_number,
test_name, test_sequence,
test_value, actual_result_date,
equipment_info, tester,
inspector, product,
bin_number, inspection_type,
flag, is_retest,
sample_no, is_active,
status, error_message,
created_by, created_date,
updated_by, updated_date
) VALUES (
v_bursting_id, v_fileid,
v_file_name, k.batch_number,
k.test_name, k.test_sequence,
k.test_value,
k.actual_result_date,
k.equipment_info, k.tester,
139
ORACLE APEX
k.inspector, k.product,
k.bin_number, k.inspection_type,
k.flag, 'N',
NULL, 'Y',
'STAGING', NULL,
:app_user, SYSDATE,
NULL, NULL
);
END LOOP;
END LOOP;
END;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20002,'Error in Getting file records.');
END;
Step 9: Create an Interactive Report in Oracle Apex by using the below query.
select BURSTING_ID, FILE_ID, FILE_NAME, BATCH_NUMBER,
TEST_NAME, TEST_SEQUENCE, TEST_VALUE,
ACTUAL_RESULT_DATE,
EQUIPMENT_INFO, TESTER, INSPECTOR, PRODUCT,
BIN_NUMBER,
INSPECTION_TYPE, FLAG, IS_RETEST, SAMPLE_NO,
IS_ACTIVE,
STATUS, ERROR_MESSAGE, CREATED_BY, CREATED_DATE,
UPDATED_BY, UPDATED_DATE, SAMPLE_TYPE,
FAILURE_CRITERIA,
DEPARTMENT
from PDD_BURSTING_STG_TBL;
Result
When the user uploads the .CSV Format file by using the File browse page Item, it will call
the Plsql Process and all .CSV File Records will be loaded into the staging table and display
in interactive report.
140
APEX PAGE COMPONENTS
Hidden
Items that are included within the page source but are not rendered. Hidden item values
are saved in session state. They are generally used to store values required by page
processing or other page items, but should not be displayed to the end user.
Below we are going to see how the hidden items are created and their
Customization. We are able to create the hidden items using two types like Page Designer
and Dynamically.
Page Designer
We can create a new page Item and select the type as “Hidden”.
141
ORACLE APEX
Value Protected
Settings, Value is Protected - Select Yes to prevent hidden values from being
manipulated when a page is posted. If we set the value as “Yes”, then checksum will be
generated whenever the form is loaded.
When we submit a page with different value for the hidden item, then the checksum
is not valid and it may throw an error.
If we set the value as “No”, we can manipulate the data for the hidden Items.
142
APEX PAGE COMPONENTS
APEX_ITEM.HIDDEN
We can create the form hidden item dynamically using the function
APEX_ITEM.HIDDEN.
Syntax
APEX_ITEM.HIDDEN(
p_idx IN NUMBER,
p_value IN VARCHAR2 DEFAULT
p_attributes IN VARCHAR2 DEFAULT NULL,
p_item_id IN VARCHAR2 DEFAULT NULL,
p_item_label IN VARCHAR2 DEFAULT NULL
) RETURN VARCHAR2;
Parameters:
p_idx Number to identify the item you want to generate. The number
determines which G_FXX global is populated
p_value Value of the hidden input form item
p_attributes Extra HTML parameters you want to add
p_item_id HTML attribute ID for the <input> tag
p_item_label Invisible label created for the item
Eg:
SELECT
empno,
APEX_ITEM.HIDDEN(1,empno) hid_emp,ename from emp;
Create a new classic report region with the above SQL Code and set the Source type
as “SQL Query”.
143
ORACLE APEX
144
APEX PAGE COMPONENTS
Set the “Escape special characters” to “No” and the output looks below.
The “Hid Emp” values seem hidden, we can view the value by inspect (Right click
on the Hid Emp field and Click Inspect) the corresponding field.
Reference:https://docs.oracle.com/en/database/oracle/application-express/19.1/htmdb/
about-item-types.html#GUID-8CAA1BA5-DCA8-4DF0-A841-3DC40E67CA9C
145
ORACLE APEX
List Manager
List Manager is a type item, that allows users to enter values and it will be added in the list.
It displays as a text item with a popup list of values icon, Add and Remove buttons, and a
list of selected values.
You can type in the value or pick from the list of available items. You can then
utilize the buttons to manage the values selected. The selected values are stored in a single
colon-delimited string.
Below we can see how to create a List Manager and their main attributes.
Create a new page item and select the type as “List Manager” and set the label as
“List”.
146
APEX PAGE COMPONENTS
Validation
Value Required- If select Yes and the page item is visible, Oracle Application Express
automatically performs a NOT NULL validation when the page is submitted.
List of Values
Type
We can choose input type for the list manager, whether you can set the data for the List
Manager by using Shared Component, SQL Query, Static values and PLSQL function body
returning SQL query.
For this below example we choose the type as “SQL Query”
In “SQL Query”, place the below code
147
ORACLE APEX
Click Save and Run the page and the list manager looks as below.
The top horizontal box is the entry box where the user will enter the data or select
the value from the list by clicking the small icon near the entry box.
Click on the “Add” button to add the entry to the list.
The lower vertical box will contain the entered items. The user can remove items
from the list by selecting the item in the list and pressing the “Remove” button.
148
APEX PAGE COMPONENTS
The list box will expand and collapse based on the entries.
On Page Submission, the value return in the form of colon separated
We can also set as Cascading LOV, by selecting the “Cascading LOV Parent Item”
and select the Item to submit value.
Number Field
Displays a number field. You can configure number range checks for values entered by
configuring the Minimum Value and Maximum Value attributes. This item type
automatically checks if the entered value is a number. No extra validations are required.
149
ORACLE APEX
Page Designer:
Create a New Item and set the type as “Number Field”.
Settings, Minimum Value - Enter the minimum value permitted. The value can be a static
value or a dynamic value using substitution syntax.
Settings, Maximum Value – Enter the maximum value permitted. The value can be a static
value or a dynamic value using substitution syntax.
150
APEX PAGE COMPONENTS
Settings, Number Alignment – Select how to align the number that displays. This setting
does not apply when the item is rendered as Read Only or where HTML Form Element
Attributes are specified.
Validation, Value Required- If select Yes and the page item is visible, Oracle Application
Express automatically performs a NOT NULL validation when the page is submitted.
151
ORACLE APEX
Minimum value and Maximum value for the item set are 10 and 40. So the value will be
accepted only in the range of 10 to 40
Enter the value for Num_check = 1 and its shows the error value should be in the range of
10 to 40
If you enter the value as 12. Then value will be accepted for the next level
processing.
152
APEX PAGE COMPONENTS
Instead of Number, we try to enter any text values, then it will throw an error as
“Num_check” must be numeric.
Reference: https://docs.oracle.com/en/database/oracle/application-express/19.1/htmdb/
about-item-types.html#GUID-8CAA1BA5-DCA8-4DF0-A841-3DC40E67CA9C
Password
The Password field item will render as an HTML Password Form Element.
It defines that what is entered into a password field shows up as dots on the screen.
This Field helps to prevent others from reading the password on the screen. It consists of
below settings as
Value Required
If you select Yes and the page item is visible, Oracle Application Express automatically
performs a NOT NULL validation when the page is submitted.
153
ORACLE APEX
This option helps the user if Select Yes is chosen, to submit the page when ENTER is
pressed. This saves the password in a database table when the page is submitted. Select No
to not save the password in a database table.
The User has only to select Yes when the password is needed in session state for use
by other pages during the session.
This option helps the user if Select Yes is chosen, to suppress text entered into the field and
not save the value in session state.
For security reasons user should always set this attribute to Yes.
154
APEX PAGE COMPONENTS
155
ORACLE APEX
document.getElementById("passwordStrength").className =
"strength" + score;
}
</script>
Step 3: Go to the HTML Form Element Attributes Of P31_PASSWORD Item and paste the
following onkeyup="return passwordStrengthmeter();"
156
APEX PAGE COMPONENTS
Step 4: Go to the Post Element Text Of P31_PASSWORD Item and paste the following
<div id="passwordDescription">Password not entered</div>
<div id="passwordStrength" class="strength0"></div>
Result
Weak Password
157
ORACLE APEX
Better Password
Medium Password
Strong Password
Radio Group
Radio group is a list of radio buttons, that provides users list of choices from where they
can choose one value at a time. It is similar to select list option, but if there are less items in
the list of values, then we can go for radio group. If there is a huge list of values then we can
go for select list.
158
APEX PAGE COMPONENTS
We can set the value for radio group by using LOV. In the LOV we can specify the
display values and value of the page item will be set to when the radio button is selected.
Below we can see how to create a simple radio group with their key attributes, and
based on the value selection in the radio button, how to display the corresponding images
for it.
Creation of Simple Radio Group and key attributes
Create a new page item and set the type as radio group
Settings
Number of Columns
Enter the number of radio group columns to display. For example, a value of 2 would
display two columns. If there were four values then it would display over two rows. In the
below example we set as 1.
Page Action on Selection
Select what action is taken when a radio group value is selected.
Execute Validations -
Displays if Page Action when Value Changed is set to Submit Page. Controls the execution
of validations when a page is submitted. Set this attribute to No to prevent the execution of
validations and associated error messages. Set this attribute to Yes to execute all page and
159
ORACLE APEX
built-in validations and associated error messages when the page is submitted. Use this
attribute in conjunction with the validation attribute.
List of Values
Type
Select the source type for the radio Group. Now we have to choose the source type as “SQL
Query”. Place the below code in SQL Query box.
select file_name,'#WORKSPACE_IMAGES#'||file_type from file_list;
The above query will display the file name and return the value as file_type.
160
APEX PAGE COMPONENTS
Output
Now we can see how to display the image based on the selected value in the radio
button.
Create a new region as “Image” and set the Parent region as “Radio”.
Set Start new row as “No”.
Upload the images in the Shared Component -> Static Workspace files.
161
ORACLE APEX
162
APEX PAGE COMPONENTS
http://www.rampant-books.com/t_easy_html_db_radio_buttons.htm
Toolbar
The toolbar, which is the area at the top of the editor, contains many different buttons that
extend and activate a variety of editor functions. The toolbar is highly personalisable and
can vary from field to field. The toolbar is collapsible. Click the triangle located next to the
toolbar to toggle between visible and collapsed.
Editing Area
The editing area is directly below the toolbar. You enter text in this area.
163
ORACLE APEX
Pop-up Menu
A pop-up menu is a contextual menu that appears when you right-click the mouse inside
an editing area. The functions on the menu change based on what element, such as a table
or an image, is under the cursor when you click the mouse.
Source:
https://docs.oracle.com/cd/E80738_01/pt854pbh2/eng/pt/tupa/task_WorkingWithRichTex
tEditorFields-c77ea3.html#topofpage
Creating Rich Text editor in Oracle apex is as simple as creating a simple text field.
Step 1: Create a static content region type.
Step 2: Create an Item either using Tree view or Component view.
Step 3: Change the type from Text to Rich Text editor.
Step 4: Click Save and Run a page to see the Rich text Editor.
To make Responsive editor
The Rich text editor is responsive in Oracle Apex 19.1. But in Oracle Apex 5.1, if you’re
using Universal Theme, then it requires the simple javascript to make the editor responsive.
Let’s see the example,
Step 1: Create a Rich text editor item using the above given steps. In my example, page
item name is P17_EDITOR.
Step 2: In Right pane, you will be able to see the properties of Rich text editor and navigate
to the “Javascript Initialization Code” attribute and place the below code,
function (o) {
o.width = $("#P17_EDITOR").closest(".t-Form-inputContainer").width()
- 5;
o.height = 300; // Specify your desired item height, in pixels
return o;
}
The above code defines the width of the region container of the item and subtracts 5
from it, and finally the output will initialise the size when the page is initially displayed. But
164
APEX PAGE COMPONENTS
note, it won't handle the case when the browser is resized. To handle this, we need to create
a dynamic action.
Step 3: Create a dynamic action as follows,
Event : Resize
True Action : Execute Javascript Code
Code :
CKEDITOR.instances.P17_EDITOR.resize( $("#P17_EDITOR").closest(".t-
Form-inputContainer").width() - 5, 300);
Let’s see a simple example. The following javascript function will set the editor's
base colour to green and we'll disable the resizing capability, so end users won't be able to
resize the editor any more. After saving the function, reload the page to see the effects.
function ( configObject ) {
configObject.uiColor = "#AADC6E";
configObject.resize_enabled = false;
return configObject;
}
165
ORACLE APEX
You can look into the below link to know the complete API that are available for
configuring objects,
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
Source: https://blogs.oracle.com/apex/how-to-fully-leverage-the-rich-text-editor
SELECT LIST
The page item Select list will display using a list of values based on some inputs. The input
should be required to display for this. Select lists are rendered using the HTML form
element <select>. The values in a select list are determined using a named list of values or a
list of values defined at the item level. The user can also specify the NULL as display value
and NULL as return value.
It consists of some settings attributes as follows:
Value Required
This option helps the user that if Select Yes chosen, and the page item is visible, Oracle
Application Express automatically performs a NOT NULL validation when the page is
submitted.
Page Action when Value Changed
This Option consists of some features like None, Submit Page, Redirect and Set Value,
Redirect to Page (based on selected value), or Redirect to URL (based on selected value).
Allow Multi Selection
This option enables the user to select multiple values in the Select List. Use the Height
attribute to define how many entries of the Select List should be visible at once.
Execute Validations
This option helps to display if Page Action when Value Changed is set to Submit Page. It
controls the execution of validations when a page is submitted. Set this attribute to No to
prevent the execution of validations and associated error messages. Set this attribute to Yes
to execute all page and built-in validations and associated error messages when the page is
submitted.
166
APEX PAGE COMPONENTS
167
ORACLE APEX
SQL Query
168
APEX PAGE COMPONENTS
Static Values
169
ORACLE APEX
Result
170
APEX PAGE COMPONENTS
Customization
Copy and paste the below script to change the colour, background colour, and font style.
.t-Form-inputContainer select.selectlist, .t-Form-inputContainer
select.yes_no, .t-Form-select {
color: red;
border-color: #dfdfdf;
background-color: aqua;
font-size: large;
}
Shuttle
The Shuttle item allows the user to select one or more values. The values listed in the left
side are the possible values from the source that are available for the user selection. The
selected values will be listed in the right side of the item. The value selection can be done by
doing double click on the values in the left side. It also provides the toolbar placed in the
middle which includes features such as Reset, Move all, Move, Remove and Remove all.
Let’s see how to create a simple shuttle item.
Creating Shuttle in Oracle apex is as simple as creating a simple select list field.
171
ORACLE APEX
Customization in Shuttle
The Shuttle is really helpful when there is a multi-selection required. But it becomes
complex when it has a lot of values as the possible value from source. To overcome this
problem, I came across Jari Laine’s blog where he added the filter to the shuttle.
Let’s see how to achieve adding filter to the Shuttle item in Oracle Apex 19.1.
Step 1: Create a Shuttle item using the above given steps. In my example, page item name is
P18_SHUTTLE.
Step 2: Now on the same page, navigate to “Function and Global Variable Declaration”
under Javascript in the page properties and add the code given below,
(function($){
$.fn.htmldbShuttlefilter=function(options){
options=$.extend({},{"label":"Filter"},options);
return this.each(function(i){
var $self = $(this)
,filterId = $self.attr("id") + "_FILTER"
,$select = $self.find("select")
,shuttleValues = $select.children("option").map(function(){
return {text:$(this).text(),value:$(this).val(),option:this}
})
,$filter =
$("<input/>",{"type":"text","value":"","size":"255","autocomplete":"off",
"id":filterId})
.keyup(function(){
var filterval = new RegExp("^"+$(this).val()+".*","i")
172
APEX PAGE COMPONENTS
,selectedValues = $select.eq(1).children("option").map(function(){
return $(this).val();
});
$select.eq(0).empty();
$.each(shuttleValues,function(idx,obj){
if(obj["text"].match(filterval) &&
$.inArray(obj["value"],selectedValues)<0){
$select.eq(0).append(obj["option"]);
}
});
})
.width($self.width());
$("<div/>",{"css":{"padding-bottom":"5px"}})
.insertBefore($self)
.append(
$("<label/>",{"for":filterId})
.append($("<span/>",{"css":{"font-
weight":"bold"}}).text(options.label))
)
.append("<br/>").append($filter);
$self.find("img[alt='Reset']").click(function(){$filter.val("")});
});
}
})(jQuery);
Step 3: Then add the code given below in the “Execute and Page loads” section available
below to the “Function and Global Variable Declaration” section.
$("#P18_SHUTTLE").htmldbShuttlefilter({});
$(".t-Form-itemWrapper").css("display","inline");
Source:
https://jaris.tilaa.cloud/apex/f?p=BLOG:READ:::NO::ARTICLE:201410131041380630
173
ORACLE APEX
TEXT FIELD
The page item Text field is displayed as an HTML text field containing a maximum of
30,000 bytes of text. It also includes the option to control the maximum length and display
width by editing the Height and Width item attribute.
It consists of some Available Text display options as below:
Text Field
This option defines that it will render as a text field.
Text Field (Disabled, does not save state)
This option helps to display a read-only version of a display value from a list of values by
using the item's value in session state to look up the corresponding display value in the
associated list of values. The value displayed on the screen is not saved in session state upon
submit.
Text Field (Disabled, saves state)
This option helps to display a read-only version of a display value from a list of values by
using the item's value in session state to look up the corresponding display value in the
associated list of values.
Text Field (always submits page when Enter pressed)
This option helps to display a read-only version of the value in session state. Upon
choosing submit, the value displayed is saved in session state.
Text Field with Calculator Popup
This option will render as a text field with an icon next to it. When clicked, the icon
displays a small window containing a calculator. Calculations are placed back in the text
field.
174
APEX PAGE COMPONENTS
Result
CUSTOMIZATION
Text Box Value to UPPER/LOWER Case
Navigate to the page where the changes are required. Click on the field/Item for which all
capital characters are required. Scroll till you reach Element section and in "HTML Form
Element Attributes" paste the below code
onKeyUp="this.value=this.value.toUpperCase();"
onChange="this.value=this.value.toLowerCase();"
Now Click on Apply Changes button and run the page. For the field this attribute is
applied, whenever a key is typed the case is changed. But if you don’t want this type of
animation and just want all characters to be in upper case,
175
ORACLE APEX
style="text-transform: uppercase;"
onKeyUp="this.value=this.value.toUpperCase();"
Navigate to the page where the changes are required. Click on the field/Item for which all
capital characters are required. Scroll till you reach Element section and in "HTML Form
Element Attributes" paste the below code
onkeydown="return isNumberss(event);"
176
APEX PAGE COMPONENTS
Navigate to the page where the changes are required. Click on the field/Item for which all
capital characters are required. Scroll till you reach Element section and in "HTML Form
Element Attributes", paste the below code
onkeypress="return avoid_special(event)"
177
ORACLE APEX
178
APEX PAGE COMPONENTS
List of Values
Type:
Select the source type for the Text field with Auto Complete. Now we have chosen the
source type as “SQL Query”.
Place the below code in SQL Query box.
SELECT ename
FROM emp;
179
ORACLE APEX
Output
Reference : https://docs.oracle.com/en/database/oracle/application-express/19.1/
htmdb/about-item-types.html#GUID-8CAA1BA5-DCA8-4DF0-A841-3DC40E67CA9C
180
APEX PAGE COMPONENTS
Customization in Textarea
Set Auto height
There is an Auto height option in the textarea which works perfectly in IE as expected. But
it is not working in other browsers. So this can be fixed by adding simple javascript code.
Let’s see it in the following steps,
Step 1: Create a Textarea item using the above steps. In my example, page item name is
P22_TEXTAREA.
Step 2: Click on Page header and navigate to Javascript section. Place the below given code
in the “Function and Global Variable Declaration”
function adjust_height(element) {
element.style.height = (element.scrollHeight)+"px";
}
Step 3: Then go to Execute when Page Loads and place code shared below,
$("#P22_TEXTAREA").attr("oninput","auto_grow(this)");
$("#P22_TEXTAREA").css("height","5px");
That’s it, now textarea will adjust its height based on the input given to it.
Add Background Image
Here we are going to see adding css to generate a highlighting effect within a textarea.
Below example shows you how to change a simple textarea to look like a piece paper effect.
The effect is complemented by the use of the old-fashioned typewriter-style font.
Step 1: Create a Textarea item using the above steps. In my example, page item name is
P22_TEXTAREA.
Step 2: Click on Page header and navigate to CSS section and place the below given code
in the “Inline” attribute,
#P22_TEXTAREA {
width:500px; overflow:hidden; background-color:#FFF;
color:#222; font-family:Courier, monospace; font-weight:normal;
font-size:24px; resize:none; line-height:40px; padding-left:100px;
padding-right:100px; padding-top:45px; padding-bottom:34px;
background-
image:url(https://static.tumblr.com/maopbtg/E9Bmgtoht/lines.png),
181
ORACLE APEX
url(https://static.tumblr.com/maopbtg/nBUmgtogx/paper.png);
background-repeat:repeat-y, repeat; -webkit-border-radius:12px;
border-radius:12px; -webkit-box-shadow: 0px 2px 14px #000;
box-shadow: 0px 2px 14px #000; border-top:1px solid #FFF;
border-bottom:1px solid #FFF;
}
Source : https://codepen.io/levchenkod
BUTTONS
Button in Oracle apex can perform four types of actions like submitting a page, redirect to
another page in the application, add custom URL and define dynamic action. Creating
Button in Oracle apex can be done either using Component view or Tree View. Refer the
following link to create a simple button,
https://docs.oracle.com/database/121/HTMDB/bldapp_but.htm#HTMDB25438
182
APEX PAGE COMPONENTS
Go to column Link in the report column section (left pane of the page designer) and
change the type to Link (right pane of the page designer).
Then scroll down to link section (right pane of the page designer). Place css code as
seen in the below screen shot,
183
ORACLE APEX
Source: https://apex.oracle.com/pls/apex/f?p=42:6100:::NO:::
Note: Same step is also applicable for Interactive report.
Glow buttons with CSS on hover
Adding effects to the items in the screen will always attract the user to your website or
application. Let’s see how to do the same in Oracle Apex.
Create a simple button on a page.
Assign a static id to it which can be seen under Advanced section of button
attribute.
Click page header and go to css inline section. Then place the following code in it.
#GLOW_BTN:hover { transform: scale(1);
box-shadow: 0 2px 4px #000, 0 8px 32px rgba(0, 0, 0, 0.5); }
Click Save.
Now button on page looks as shown in the below figure on hover.
184
APEX PAGE COMPONENTS
Click page header and go to css inline section. Then place the following code in it.
#Button1:hover {-webkit-border-radius: 25px; -moz-border-radius: 25px;
border-radius: 25px; }
Click Save.
Now button on page looks as shown in the below figure on hover.
185
CHAPTER
8
PAGE DESIGNER
The Page Designer window features three panes: a Left pane, a Central pane, and a Right
pane.
Usually we segregate this as Page rendering, Page Processing and Shared
components. This was the case before 5.0 version. In later versions Oracle has introduced
page layout designer which enables drag and drop option for creating page components
which was taking a bit longer without this option. The left pane enables the developer to
add page components and dynamic action for all the page events and page processing at
different stages of page action.
187
ORACLE APEX
188
PAGE DESIGNER
The last but not least, we have the shared component list which is being used in the
page and can be edited from the page itself.
Centre Pane
Grid Layout
The grid layout is the place where the developer can place the page components in the
different page sections, like after header, navigation, breadcrumb, etc., and rearrange by
dragging it to the desired page, which makes the task easy and fast, enabling the developer
to concentrate on the other important sections like security, instead of spending time in
arranging the items with html codes.
Message
The message section was introduced in 18 version, where instead of having errors one after
the other, the developer can see all the error messages at once.
Page Search
The page search enables the developer to search the page instantly. Say, the developer
wants to know whether the particular table is used in the page or not. Assume that this
feature is not available, the developer needs to open each and every component in the page
to see whether the table is available or not.
Help
This section tells the developers what is the selected component about and what are the
details of the options in the component.
Right Pane
This pane is the heart of the component, and this enables the developers to change the
attributes of the page components.
189
ORACLE APEX
190
CHAPTER
9
SHARED COMPONENTS
APPLICATION LOGIC
The Application Logic is one of the modules in Shared components. It consists of different
types of features as below:
Application Definition Attributes
Application Items
Application Process
Application Computations
Application Settings
Build options
191
ORACLE APEX
Properties
Application Icon
192
SHARED COMPONENTS
Availability
Error Handling
Global Notification
Substitutions
193
ORACLE APEX
Build Options
Security
This option helps the user to use this page to set application-wide security settings. Edit
application components directly to manage more granular settings.
It consists of some following features as below:
Authentication
Authentication is the process of establishing each user's identity before they can access your
application. You may define multiple authentication schemes for your application, however
only one scheme can be current. The authentication logic of the current scheme is used
when your application is run.
Authorization
Application authorization schemes control access to all pages within an application.
Unauthorized access to the application, regardless of which page is requested, will cause an
error page to be displayed.
Session Management
This option helps to control the application session management.
Session State Protection
Enabling Session State Protection can prevent hackers from tampering with URLs within
your application. URL tampering can adversely affect program logic, session state contents,
and information privacy.
To enable Session State Protection for your application, select Enabled from the Session
State Protection list. Enabling Session State Protection turns on session state protection
controls defined at the page and item level. To configure Session State Protection, click
Manage Session State Protection.
194
SHARED COMPONENTS
Browser Security
This option helps to control the application Browser Security Management.
Database Session
This option helps to control the application Database Session management.
Authentication
Authorization
Session Management
195
ORACLE APEX
Browser Security
Database Session
Globalization
This option helps the user to identify the globalization attributes of your
application. It consists of application translations.
196
SHARED COMPONENTS
User Interface
This option helps the user to change the UI Settings of the application.
It consists of following types as:
User Interfaces
General Properties
Logo
Favi-Icon
User Interface Detection
User Interfaces
197
ORACLE APEX
General Properties
Logo
Favi-Icon
Application Items
The User can use application Items to maintain session state. Application Items can be set
using computations, processes, or by passing values on a URL. Use "On New Instance"
computations to set the value of items once for a session. Use Application Items to
maintain session state that is not displayed and is not specific to any one page.
198
SHARED COMPONENTS
Security
Configuration
Comments
Application Process
Application Processes run PL/SQL logic at specific points for each page in an application or
as defined by the conditions under which they are set to fire. Note that "Ajax Callback"
processes fire only when called from Ajax or by "Run Ajax Callback" processes defined for
pages. It consists of some following types as
199
ORACLE APEX
Name
Source
Conditions
Authorization
200
SHARED COMPONENTS
Configuration
Comments
Application Process
The user can use Application Computations to assign values to application and page items.
It consists of below types as
Item
Frequency
201
ORACLE APEX
Computation
Authorization
Conditions
Configurations
Comments
202
SHARED COMPONENTS
Application Settings
The Application Settings enable developers to define application level configuration
options.
You can use the following APIs within your application to access your application
settings:
To set a value for a setting: apex_app_setting.
set_value().
Build Options
The Build options enable developers to conditionally enable and disable application
components and functionality when the application is installed or at run time using the
GET_BUILD_OPTION_STATUS and SET_BUILD_OPTION_STATUS APIs.
The user can apply build options to most components (such as pages, regions,
items, validations, and so on) to include or exclude them in the run time application:
203
ORACLE APEX
204
SHARED COMPONENTS
SECURITY
The common discussion around Oracle apex is when you say it’s browser based, the next
question that comes to you would be, “How secured is you application?”. The best answer
we can give is, “Oracle store is built with oracle apex.” Yes you heard it right; it is one of the
secured applications where you can perform even financial transactions using apex. There
are different features to enhance the security. We shall see some of them.
Authentication
Authorization
Session Management
Session State Protection
Authentication
It is a process or action to verify the identity of the user using password. This can be done
in different ways as below:
Application express accounts – this uses user accounts and passwords that are
created and managed within Oracle Application Express user repository. Your
application is authenticated against these accounts.
Custom – as always there will be different needs for different users, hence this
enables them to sculpture their own authentication using plsql program.
Database account – this uses the schema username and password from the database
where apex is installed. This acts more like no authentication is selected
HTTP Header variable – this is used only for the single sign on from some other
application.
LDAP directory – when you have LDAP server you can use the same credentials
maintained in the server.
Oracle Server single sign on—this uses the credentials maintained in Oracle server.
Authorization
Many of the users still get puzzled with authentication and authorization. The basic
difference is, authentication is like a lock in your laptop or desktop, which enables the user
205
ORACLE APEX
to login and use the system, but authorization is like access given for each user to use only
software allowed to them. We can define the authorization at each item level also.
Authorization Scheme
Description
Types
Exists SQL Query Enter a query that causes the authorization scheme to pass if it
returns at least one row and causes the scheme to fail if it
returns no rows
NOT Exists SQL Query Enter a query that causes the authorization scheme to pass if it
returns no rows and causes the scheme to fail if it returns one
or more rows
PL/SQL Function Enter a function body. If the function returns true, the
Returning Boolean authorization succeeds.
Item in Expression 1 is Enter an item name. If the item is null, the authorization
NULL succeeds.
Item in Expression1 is Enter an item name. If the item is not null, the authorization
NOT NULL succeeds.
Value of Item in Enter an item name and value. The authorization succeeds if
Expression 1 Equals the item's value equals the authorization value.
Expression 2
Value of Item in Enter an item name and a value. The authorization succeeds if
Expression 1 Does NOT the item's value is not equal to the authorization value.
Equal Expression 2
206
SHARED COMPONENTS
Authorization Scheme
Description
Types
Is Not In Group Enter a group name. The authorization succeeds if the group is
not enabled as a dynamic group for the session.
Source: https://docs.oracle.com/html/E39147_04/sec_authorization.htm
Session Management
Session state management is done with the session ID and this session values will be
maintained by the item in the browser and developer can restrict the values being changed
by the users.
Session state protection
Session state can be protected adding checksum to the url
207
ORACLE APEX
OTHER COMPONENTS
The following are the list of other components that are under shared components.
List of values
Plug-ins
Component settings
Shortcuts
Email Templates
Below we can see how we create the components and their details.
List of Values
A list of values (LOV) is a static or dynamic set of values used to display a popup list of
values, select list, check box, or radio group.
208
SHARED COMPONENTS
In the following example we can create sample LOV with name as “Test” and place
the SQL Query in Query box.
E.g.
select ename as d,
empno as r
from emp
order by 1
We can include the Shared component LOV on the Page level item creation.
In List of Values, set the type as “Shared Components” and further in List of values
set as “Test”.
209
ORACLE APEX
Plug-ins
App Builder includes built-in item types, region types, dynamic actions, and processes. Use
plug-ins to add new declarative types into your application.
We can create a new plugin and assign the name for it.
In PLSQL Code, we can set the process code for the plugin and that can be used in
regions type, Item type, dynamic actions and processes.
210
SHARED COMPONENTS
We can import the other plugins by using the option “Import” and it has been
included as Application level, and it will be available in all pages based on the category how
the plugin has been created.
Component Settings
Use Component Settings to set application-level values for built-in Oracle Application
Express components and installed plug-ins.
211
ORACLE APEX
Shortcuts
Use shortcuts to avoid repetitive coding of HTML or PL/SQL functions. You can create a
shortcut to define a page control such as a button, HTML text, a PL/SQL procedure, or
HTML. Once you define a shortcut, it is stored in a central repository so you can reference
it from various locations within your application.
Shortcuts are a repository of shared static or dynamic HTML. Shortcuts are
substitution strings that are expanded using the syntax: "SHORTCUT_NAME". Shortcuts
are used in the following locations:
Region Source for regions of type HTML_WITH_SHORTCUTS
Region Templates, Region Headers and Footers
Item Labels
Item Default Value
Item Post Element Text
Item Help Text
HTML Header of a page
212
SHARED COMPONENTS
Email Templates
Create templates to define the HTML format and Plain Text formats for the emails you
wish to send from an application.
Before we send email from an application, your Instance administrator must log in to
Oracle Application Express Administration Services, navigate to the Instance Settings page
and configure Email attributes.
Template Name – Enter a descriptive name for this template.
Static Identifier – Static string identifier used to refer to the template when calling
the APEX_MAIL APIs.
Email Subject – Enter the text to display for the email subject.
Define the Header, Body, and Footer. Body supports basic HTML markup.
Under Advanced, optionally click Load Default HTML.
The default HTML appears in the HTML Template. If needed, edit the default
HTML Template.
Under Plain Text Format, enter the appropriate template defaults.
Under Comments, optionally enter comments that describe this template.
Click Create Email Template.
Next, create a button and process to call the APEX_MAIL API to send email.
213
ORACLE APEX
Reference: https://docs.oracle.com/en/database/oracle/application-express/18.2/htmdb/
shared-components-page.html#GUID-A3FBCD13-FF7A-45F0-8DCB-B45C18EFCAC7
NAVIGATION
The Navigation region on the shared component has the following links,
Lists
Navigation Menu
Breadcrumbs
Navigation Bar List
Lists
The collection of links is a list. A list will be available under Navigation region on the
Shared Components. The appearance of the list display in the page is based on the list
templates. Each list can be controlled by adding a display condition to it. Let’s see how to
create a list.
Two types of lists can be created in Oracle Application Express:
Static Lists
Dynamic Lists.
Static Lists
A Static List is based on predefined display and return values. When you wish to create a
static list, a list entry label and target (either a page or URL) attributes need to be defined. A
static list can be creating using the following option, creating from scratch, by copying
existing entries, or by adding the list entries. Each list will have display condition, which
enables to control its display.
The following describes how to create a Static List:
Navigate to the application shared components.
Create the list using the Create List Wizard.
Mention whether to create the list from scratch or by copying an existing list.
If the option from scratch is chosen, then enter the details for the Name, Select type
as Static and click next.
214
SHARED COMPONENTS
Navigation Menu
A navigation menu is a list link that enables users to navigate the pages in an application.
Navigation menus are only supported in the applications using the Universal Theme. A
navigation menu is a list with hierarchical list entries. When you create an application, the
Create Application Wizard automatically creates a navigation menu for you and populates
it with list entries linking to the application pages you have created. The example below
shows the Sample Database Application with a navigation menu displaying as a sidebar. In
215
ORACLE APEX
this example, the navigation menu includes list entries for the application pages: Home;
Customers; Orders; Reports; and Administration.
Breadcrumbs
A breadcrumb is a hierarchical list of links that shows where the user is within the
application from a hierarchical perspective. It helps the users to click a specific breadcrumb
link to view the page instantly. We can use breadcrumbs as a second level of navigation
which will always place at the top of the page, complementing other user interface elements
such as tabs and lists.
216
SHARED COMPONENTS
USER INTERFACE
The following is a list of links under User interface on the Shared Components page.
User Interface Attributes
Themes
Templates
217
ORACLE APEX
E.g. We can change the theme style and set the home page and login page details.
By default its Universal theme and theme style is “Vita”. We can also change the
theme style.
New Theme Style: Vita - Dark
218
SHARED COMPONENTS
Themes
A theme is a named collection of templates that defines the application user interface.
If you want to edit the theme then we can copy the theme and we can customize the
theme that we want to edit.
There are multiple options to edit the theme by using the below methods.
219
ORACLE APEX
Copy theme
Delete theme
Import theme
Export theme
Copy theme
We can copy the theme by selecting the copy theme button.
220
SHARED COMPONENTS
Delete Theme
We can delete the theme by clicking the button “Delete Theme” and click Next and Delete
Theme to delete the theme.
Import Theme
We can import the theme by clicking the Import theme button.
Export theme
We can Export the theme by clicking the Export theme button.
221
ORACLE APEX
Switch Theme
Switch theme option is used to switch the old theme to new theme.
Templates
The Application Express engine constructs the appearance of each page in an application
using Templates. Templates control the look and feel of specific constructs within your
application, such as pages, regions, items, and menus.
To edit template attributes, select the template name. To preview a template, click
the Run icon.
222
SHARED COMPONENTS
223
ORACLE APEX
Reference: https://docs.oracle.com/en/database/oracle/application-express/18.2/htmdb/
shared-components-page.html#GUID-A3FBCD13-FF7A-45F0-8DCB-B45C18EFCAC7
FILES
The following describes the files links on the shared component.
Static Application Files
Static Workspace Files
224
SHARED COMPONENTS
Enter the name of the directory in the directory field where the file should be
stored. If nothing is specified, then by default the file will be stored in the root
directory.
Select file to be uploaded by specifying in File.
Mention the character set encoding for the file if required.
Select the option Yes/No for unzip file.
Click Upload.
To View and Delete,
Navigate to the shared component page in application.
Select Static Application files under Files.
A Report appears. A Column File Name will act as link to edit the files.
Click any of the filename.
Information will be displayed in the pop up.
To delete, click Delete button.
To exit, click Exit button.
To Download,
Navigate to the shared component page in application.
Select Static Application files under Files.
A Report appears with the following columns,
o File Name
o Mime Type
o File Size
o Reference
o File
Locate the file to be downloaded and click the Download link.
225
ORACLE APEX
To practise the above mentioned action, follow the steps given below:
To Upload,
Navigate to the shared component page in application.
Select Static Workspace files under Files.
Click Upload to upload file.
Enter the name of the directory in the directory field where the file should be
stored. If nothing is specified, then by default the file will be stored in the root
directory.
Select file to be uploaded by specifying in File.
Mention the character set encoding for the file if required.
Select the option Yes/No for unzip file.
Click Upload.
To View and Delete,
Navigate to the shared component page in application.
Select Static Workspace files under Files.
A Report appears. A Column File Name will act as link to edit the files.
Click any of the filename.
Information will be displayed in the pop up.
Click Delete button to delete.
To exit, click Exit button.
To Download,
Navigate to the shared component page in application.
Select Static Workspace files under Files.
A Report appears with the following columns,
o File Name
o Mime Type
o File Size
o Reference
o File
Locate the file to be downloaded and click the Download link.
226
SHARED COMPONENTS
Source: https://docs.oracle.com/en/database/oracle/application-express/19.1/htmdb/
shared-components-page.html#GUID-B9987FB8-956A-456F-8588-F20B5CD8F569
REPORTS
The Report region on the shared component has the following links,
Report Queries
Report layouts
Report Queries
Defining a report query on the shared component helps to print report region within the
current application. A report Query identifies the info to be extracted. In contrast to SQL
statements contained in regions, report queries containing SQL statements will be validated
when the query is saved. Note that report queries should be SQL statements, not functions
returning SQL statements.
With a report design, you can match a report query and download it as a formatted
document. A generic layout is used if no report layout is selected. The purpose of the
generic layout is to test and verify a report query. Only the first result set is included in the
print document when using the generic layout option and multiple source queries are
defined.
You then incorporate these reports with the application to make them accessible to
end users. For example, a report query can be associated with a button, list item, branch, or
other navigation component that allows you to use URLs as targets. Then selecting that
item starts the process of printing.
Creating a Report Layout
Navigate to the shared component of your current application.
Click Report Queries under Reports.
Click Create.
Specify the information for the following,
o Report Query Name
o Output Format
227
ORACLE APEX
o Item
o View file as
o Session State
o Click Next.
Provide the SQL statement for SQL query section.
Specify the information to Data Source for Report layout under Download
Definition and Click Next.
Provide the information for the following,
o Report Layout Source – If ‘Create file based report layout’ is selected then
‘Report layout file’ field is mandatory.
o Layout Name – Enter a layout name.
o Report Layout File – Click Browse and select Rich Text Editor.
o Click Next.
Final screen will appear, view the information shown in the screen and click Create
to create Report Query.
Report Layout
Using Report Layout, either a classic report region or a report query can be formatted and
renders the data in a printer-friendly format. If a report layout is not selected, a default
XSL-FO layout will be used. The default layout of XSL-FO is always used to make
interactive reports region.
To create a report layout,
Navigate to the shared components page.
Click Report Layout under Reports.
Click Create.
Select a report layout type and click next.
o Generic Columns (XSL-FO) – Uses the default template to populate the
report. You can customize the default code in the next step.
o Named Columns (XSL-FO) – If Named Columns (XSL-FO) is selected then
it requires XSL-FO or RTF file to be uploaded in the next step.
228
SHARED COMPONENTS
Provide the appropriate information for the option shown. Note the option on this
page will appear based on the report layout selection done in the previous page.
Click Create Layout.
To Edit a report layout,
Navigate to the Shared Components page.
Click Report layout under Report region.
The report will appear with information if the report layout is created already.
Select the layout you want to edit.
A pop up will appear, do the necessary changes and click Apply Changes. This is for
generic column layouts.
For named column layouts, click Download and do the changes in the file and
upload the revised file.
Source: https://docs.oracle.com/en/database/oracle/application-express/19.1/htmdb/
shared-components-page.html#GUID-C075D396-A6F6-4B1D-835A-58EC4240FFF8
GLOBALIZATION
The following are the list of links under Globalization on the Shared Components page.
Globalization Attributes
Text Messages
Translate Application
Globalization Attributes
We can develop applications that can run concurrently in different languages. Click this
link to specify globalization options such as the Application Primary Language and
Application Language Derived From attributes.
229
ORACLE APEX
We can set the application date format. Once the date format has been set, then it
will be set for the whole application. Whenever we select the date from date picker, it will
set as the format that we mentioned in globalization.
Document Direction
We can set the document reading direction. By default it is from left to right.
We can change it to from right to left also.
Below is a simple example to change the primary language type to “Chinese”
230
SHARED COMPONENTS
Now create a new date picker item and the format looks as below with format
“DD-MON-YYYY”.
Once we create a new application, and set the format as above, it will help to reflect
for all the pages.
231
ORACLE APEX
Text Messages
Text Messages can be used to build translatable text strings with substitution variables that
can be called from PL/SQL packages, procedures, and functions.
We may need to translate messages if your application:
Includes PL/SQL regions or PL/SQL processes, or calls a PL/SQL package,
procedure, or function. If it does, you may need to translate the generated HTML.
Uses a language that is not one of the ten languages into which Oracle Application
Express is translated. If it does, you may need to translate messages used in reports.
We can create text message by click the button “Create Text Message”.
We create a new text message for the translation and set the name for it.
232
SHARED COMPONENTS
Translate Application
Applications can be translated from a primary language into other languages. Each
translation results in the creation of a new translated application. Each translation requires
a mapping which identifies the target language as well as the translated application ID.
Translated applications cannot be edited directly in the App Builder.
Once the translation mappings are established, the translatable text within the
application is seeded into a translation repository. This repository can then be exported to
an XLIFF for translation.
Once the XLIFF file is populated with the translations, one file per language, the
XLIFF file is uploaded back into the translation repository. The final step is to publish each
translated application from the translation repository.
A translated application will require synchronization when the primary application
has been modified since the translated version was last published. Even modifications to
application logic will require synchronization. To synchronize, seed and publish the
translated application.
233
ORACLE APEX
Reference:
https://docs.oracle.com/en/database/oracle/application-express/18.2/htmdb/translating-
messages.html#GUID-2B07BBBC-AFF6-493D-B173-81C7C97C26DB
https://docs.oracle.com/en/database/oracle/application-express/18.2/htmdb/shared-
components-page.html#GUID-270EA688-3883-4D37-8435-914648A25021
234
CHAPTER
10
INTEGRATION WITH OTHER DATABASE WITHOUT
DBLINK
When we say integration with other database. The first thing that comes to your mind is
DBlink. This was the case before webservice. Now we can integrate two or more databases
to Apex. Let’s see how we achieve it.
Web service is a standardized medium to transfer or transmit data between the
client and server applications LAN or WAN.
There are mainly two types of web services.
SOAP web services.
RESTful web services.
SOAP web service – it’s an XML based protocol to access the web service and it is light
weight and recommended by W3C consortium, which is the governing body for all web
standards. The REST is an abbreviated form of a REpresentational State Transfer
RESTful web services – REST is used to build web service which is lightweight and
scalable.
POST – This would be used to create a new employee using the RESTful web
service
GET – This would be used to get a list of all employees using the RESTful web
service
235
ORACLE APEX
PUT – This would be used to update all employees using the RESTful web service
DELETE – This would be used to delete all employees using the RESTful web
service
The following are the steps to create endpoint
Step 1: From the Oracle Application Express Home page, select the SQL Workshop tab and
select the RESTful services.
Step 2: From RESTful services page, Select the Create Module Service Option.
Step 3: Under ORDS Module Definition Enter the Module Name, Base Path and other
required details. Then select the Create Module option.
236
INTEGRATION WITH OTHER DATABASE WITHOUT DBLINK
237
ORACLE APEX
Step 5: Under ORDS Template Definition Enter the URI template, Priority and HTTP
Entity tag type. Then select the Create template option.
Step 7: Under ORDS Handler Definition select method and source type. Then select the
Create Handler option.
238
INTEGRATION WITH OTHER DATABASE WITHOUT DBLINK
Step 8: Then Select the Template Name created by you and Copy URL from full URL
Section.
239
ABOUT DOYENSYS
241
ABOUT DOYENSYS
We received ‘India's Great Mid-size Workplaces’ award (Rank #19) based on the
feedback given by our employees in strict confidence and evaluation of various parameters
242
ABOUT DOYENSYS
by Great Place to Work. We are an equal opportunity employer and do not discriminate
based on sex, religion, gender, nationality, etc. Our women are given a lot of flexibility to
work in the organization, understanding the time that they need to spend with their family.
We are also proud to share that we received the award ‘Best Workplaces for
Women’ from Great Place to Work and were ranked among the top 75 in IT and BPM Best
Workplaces.
The culture to excel is at the heart of everything Doyens do. We not only share and
care for other folks within the organization but also for the folks around the globe.
We have Database and Oracle EBS blogs available on the Doyensys page and are
accessible on the internet. These blogs are exemplary work done by Doyens from the
243
ABOUT DOYENSYS
knowledge and experience gained by supporting various customers across the globe. There
is a habit of creating reusable components for the teams within Doyensys so that a similar
piece of work can be helpful for some other project within the organization.
The management is very supportive and encouraging, which is very much visible
from the awards [Passion and Commitment, Commitment and Customer Delight, Rookie
of the Year] that are given to Doyens, who excel in various categories.
Doyensys is not only a great place to work but is also a great place to learn as
employees are always encouraged to explore new technologies and suggest innovative ideas
that can benefit the clients. The teams within Doyensys are always encouraged and
recognized by the management to add value to the work that is delivered to the customer
rather than just doing monotonous work.
244
ABOUT THE AUTHORS
RAJAN CHANDRU
Rajan Chandru, a co-author of this book, lives in Chennai and is a
Senior Consultant at Doyensys Pvt. Ltd. He is an Oracle Certified
Associate with over eight years of rich experience in application
development using Oracle Application Express and software
development lifecycle. He has worked from APEX 3.0 version and
developed applications for financial and pharmaceutical industries on
different applications and was involved in data migration and
implementation projects.
SATHYA JEGAN
Sathya Jegan, a co-author of this book, is a Senior Consultant at
Doyensys Pvt. Ltd., and is an Oracle Certified Associate. He has over
eight years of experience in application development using Oracle
Application Express and has worked from APEX 3.0 version, and
developed applications for pharmaceutical industries and worked on
projects for managing database involved in data migration and
implementation projects
245
ABOUT THE AUTHORS
KARTHIK SENTHILMURUGAN
Karthik Senthilmurugan is one of the co-authors of this book. He is a
Consultant at Doyensys Pvt. Ltd. He has more than four years of
experience in application development using Oracle Application
Express and has worked from APEX 4.2 version and developed
applications for foundry management and pharmaceutical industries
on different applications and was involved in data migration and
implementation projects.
PANDIMUNEESWARAN KALIRAJAN
Pandimuneeswaran Kalirajan is one of the co-authors of this book. He
is a Consultant at Doyensys Pvt. Ltd. He has over five years of
experience in application development using Oracle Application
Express and has worked from APEX 4.2 version, Oracle forms and
reports, and developed applications for foundry management and
pharmaceutical industries on different application and was involved in
data migration and implementation projects.
246