Oracle Application Express: Developing Database Web Applications
Oracle Application Express: Developing Database Web Applications
Oracle Application Express: Developing Database Web Applications
Hands-On-Labs Guide
This exercise includes six hands-on-labs and uses the Demo Projects application.
HOL 14-1 Creating and Customizing a Calendar: In this lab, you add a Calendar in the Demo
Projects application. Later, you edit the calendar attributes and enable the drag and drop functionality.
HOL 14-2 Modifying the Dashboard Page: In this hands-on lab, you first create a blank page
named Reports. You select Reports as the Parent Navigation Menu Entry when you create the My
Outstanding Tasks and the Project Tree page in this application.
HOL 14-3 Updating the Project Tasks Chart: The Project Tasks chart has already been created in
the Dashboard page. This lab covers updating the Project Tasks chart to review the completed and
incomplete tasks.
HOL 14-4 Adding the Project Milestones Chart: In this lab, you create the Project Milestones
chart to depict past milestones and future milestones. You will also create a copy of the Project Tasks
chart and then edit the chart attributes including the source query.
HOL 14-5 Adding the Project Status Chart: In this hands-on lab, you create the Project Status
chart to depict the completed, in-progress and assigned status of the projects.
HOL 14-6 Adding the Project Tree: In this hands-on lab, you create a blank page and then create a
Tree region. To perform the steps in this lab, you need the Project_Tree.sql file which is included in
the apex-course-labs.zip.
2
Oracle Application Express: Developing Database Web Applications
1. Navigate to App Builder and in the report, click Demo Projects application.
4. Enter Calendar for Page Name, select Breadcrumb for Breadcrumb, and click Next.
3
Oracle Application Express: Developing Database Web Applications
5. For Navigation Preference, select the Create a new navigation menu entry radio button.
Click Next.
4
Oracle Application Express: Developing Database Web Applications
5
Oracle Application Express: Developing Database Web Applications
7. Select NAME for Display Column, and END_DATE for End Date Column.
Click Create.
6
Oracle Application Express: Developing Database Web Applications
9. The Calendar page displays the region title Calendar, and also has a border around the region.
In the Rendering tree, locate the Calendar region. Click Calendar.
In the Property Editor, under Appearance, click the Template Options button.
7
Oracle Application Express: Developing Database Web Applications
8
Oracle Application Express: Developing Database Web Applications
9
Oracle Application Express: Developing Database Web Applications
12. You want to update the navigation menu. In the application home page, click Shared
Components.
10
Oracle Application Express: Developing Database Web Applications
11
Oracle Application Express: Developing Database Web Applications
18. In the navigation menu, notice the new icon. In the Developer Toolbar, click Edit Page <n>.
12
Oracle Application Express: Developing Database Web Applications
19. You need to add the Create and View / Edit links. In the Rendering tree, locate
the Calendar region.
Click Attributes under the Calendar region.
In the Property Editor, locate Create Link and click No Link Defined.
13
Oracle Application Express: Developing Database Web Applications
20. In the Link Builder – Create Link dialog, select 9 for Page, and enter 9 for Clear Cache.
Click OK.
21. In the Property Editor, locate View/Edit Link and click No Link Defined.
22. In the Link Builder – View / Edit Link dialog, input the following:
• Page - select 9 - Maintain Task
• Name - select P9_ID
• Value - select ID or enter &ID.
• Clear Cache - enter 9
Click OK.
23. You can enable calendar drag and drop by using the component attribute Drag and Drop. Your
SQL query must select a primary key column and you must have set the Primary Key Column
calendar attribute. Then enter the PL/SQL code to update the event row in the database in the
Drag and Drop PL/SQL Code attribute. That PL/SQL code typically performs a SQL update
on the database table - the bind variables :APEX$PK_VALUE., :APEX$NEW_START_DATE
and :APEX$NEW_END_DATE contain the dragged events primary key value as well as the
new start and new end timestamp.
• In the property editor, navigate to Primary Key Column, and select ID.
• Click the status bar to Enable Drag and Drop.
14
Oracle Application Express: Developing Database Web Applications
For Drag and Drop PL/SQL Code, copy and paste the following code:
begin
update DEMO_PROJ_TASKS
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;
15
Oracle Application Express: Developing Database Web Applications
16
Oracle Application Express: Developing Database Web Applications
In this hands-on lab, first you create a blank page named Reports. You select Reports as the Parent
Navigation Menu Entry for the My Outstanding Tasks report and the Tree page you create in the
Demo Projects application.
You move the My Outstanding Tasks report region in the Dashboard to a new page.
1. First, create a blank page in the Demo Projects application. In the application home page,
click Create Page.
3. Enter Reports for Name, select Breadcrumb for Breadcrumb, and click Next.
17
Oracle Application Express: Developing Database Web Applications
6. In the page designer toolbar, click Shared Components. (not Page Shared Components).
18
Oracle Application Express: Developing Database Web Applications
19
Oracle Application Express: Developing Database Web Applications
15. Enter My Outstanding Tasks for Name, select Breadcrumb for Breadcrumb, Reports for
Parent Entry, and click Next.
20
Oracle Application Express: Developing Database Web Applications
16. Select Create a new navigation menu entry for Navigation Preference.
Select Reports for Parent Navigation Menu Entry.
Click Next.
21
Oracle Application Express: Developing Database Web Applications
20. Under Rendering, right-click My Outstanding Tasks classic report region and select
Copy to other Page…
22
Oracle Application Express: Developing Database Web Applications
21. For To Page, select the page number of the blank page that you created in step 13 above.
Click Next.
22. Make sure the Region Name is My Outstanding Tasks and click Copy.
23
Oracle Application Express: Developing Database Web Applications
23. Under Rendering, right-click My Outstanding Tasks region and select Delete.
Click Save.
24
Oracle Application Express: Developing Database Web Applications
24. In the page designer, navigate to the page on to which you just copied the My Outstanding
Tasks classic report region.
25
Oracle Application Express: Developing Database Web Applications
26. You now see the My Outstanding Tasks classic report. In the Developer Toolbar, click Edit
Page <n>.
26
Oracle Application Express: Developing Database Web Applications
27
Oracle Application Express: Developing Database Web Applications
28
Oracle Application Express: Developing Database Web Applications
In this hands-on lab, you update the Project Tasks Chart in the Dashboard page.
29
Oracle Application Express: Developing Database Web Applications
30
Oracle Application Express: Developing Database Web Applications
In this hands-on lab, you create a bar chart to show the past and future milestones. You add this
chart into the Dashboard page.
1. In the Page Designer, under Layout, right-click the Tasks Review region, and select Copy To
> Content Body > Tasks Review > Column After.
2. The chart region is now copied. Under Rendering, select the Tasks Review region.
In the property editor, under Identification, enter Milestones Review for Title.
31
Oracle Application Express: Developing Database Web Applications
3. Now, you need to modify the region source query and chart attributes.
Under Rendering, expand Regions > Milestones Review and select Attributes.
In the property editor, for Appearance > Orientation, select Vertical.
32
Oracle Application Express: Developing Database Web Applications
4. Under Rendering, expand Regions > Milestones Review > Series and select Tasks.
In the property editor, under Identification, enter Milestones for Name.
For Source > SQL Query, copy and paste the following SQL:
select p.id
, p.name as label
, (select count('x') from demo_proj_milestones m
where p.id = m.project_id
and m.due_date < sysdate
) value
, 'Past Milestones' series
, p.created
from demo_projects p
UNION ALL
select p.id
, p.name as label
, (select count('x') from demo_proj_milestones m
where p.id = m.project_id
and m.due_date >= sysdate
) value
, 'Future Milestones' series
, p.created
from demo_projects p
order by 5
33
Oracle Application Express: Developing Database Web Applications
Note: If you get an error make sure to check, Property Editor, Column Mapping, for Series
Names SERIES is selected, for Label LABEL is selected, and for Value VALUE is selected.
34
Oracle Application Express: Developing Database Web Applications
35
Oracle Application Express: Developing Database Web Applications
In this hands-on lab, you create a pie chart to review the project completion status. You add this
chart in to the Dashboard page.
2. In the property editor, under Identification enter the region title as Project Status.
36
Oracle Application Express: Developing Database Web Applications
4. In the property editor, under Column Mapping, select DESCRIPTION for Label
and VALUE for Value.
37
Oracle Application Express: Developing Database Web Applications
38
Oracle Application Express: Developing Database Web Applications
6. Under Legend:
Select End for Position.
Select Rescale for Hide and Show Behavior.
39
Oracle Application Express: Developing Database Web Applications
7. Under Rendering, expand Project Status > Series and select Status.
8. In the property editor, for Label > Show, click to Enable the feature.
For Label > Display As, select Label.
10. The Project Status chart is now displayed in the Dashboard page.
In the Developer Toolbar, click Application < n >.
40
Oracle Application Express: Developing Database Web Applications
41
Oracle Application Express: Developing Database Web Applications
In this hands-on lab, you create the Project Tree. You also create a blank page and then add the Tree
region.
Note: You can create a Tree page by using the Create Page wizard.
1. First, create a blank page in the Demo Projects application. In the application home page,
click Create Page.
42
Oracle Application Express: Developing Database Web Applications
43
Oracle Application Express: Developing Database Web Applications
44
Oracle Application Express: Developing Database Web Applications
7. In the property editor, for Identification > Title, enter Project Tree.
For Identification > Type, select Tree.
Under Source, make sure Local Database for Location is selected and select SQL Query for
Type.
The apex-course-labs.zip file includes Project_Tree.sql file. On your local folder, navigate to the
location where you unzipped the zip file and open Project_Tree.sql.
Copy the SQL code from this file and then paste it in to Source > SQL Query in the page
designer.
45
Oracle Application Express: Developing Database Web Applications
8. In the page designer, navigate to Appearance and then click the Template Options button.
Click OK.
46
Oracle Application Express: Developing Database Web Applications
10. In the Rendering tree, under Content Body > Project Tree, select Attributes.
In the property editor, navigate to Settings and select / enter the following:
• Node Label Column: TITLE
• Node Value Column: VALUE
• Hierarchy: Not Computed
• Node Status Column: STATUS
• Hierarchy Level Column: LEVEL
• Tooltip: Database Column
• Tooltip Column: TOOLTIP
47
Oracle Application Express: Developing Database Web Applications
48
Oracle Application Express: Developing Database Web Applications
49