Build a Developer-Wise Task Management System Using PL/SQL, Dynamic HTML, and Interactive Task Controls
1. Introduction
Task management is an important part of every software development team. When multiple developers are working on different assignments, it becomes necessary to organize tasks, assign responsibilities, monitor progress, and identify completed and pending work.
In this blog, I will demonstrate how to build a Tasks Management System in Oracle APEX using PL/SQL, SQL queries, APEX form components, dynamic HTML generation, and JavaScript.
The application provides a simple interface where users can create tasks, assign them to developers, view tasks grouped by developer, mark tasks as completed, and delete tasks when they are no longer required.
One of the interesting parts of this implementation is the developer-wise task display. Instead of showing all tasks in a traditional report, the application dynamically generates an expandable list using PL/SQL and HTML. Each developer is displayed with their task count, and clicking the developer name reveals the associated tasks.
The solution demonstrates how Oracle APEX developers can combine database operations with custom HTML, CSS, JavaScript, and PL/SQL to build an interactive task management interface.
2. Project Overview
The Tasks Management System is developed around two main database entities:
-
DEVELOPERS: Stores developer information.
-
TASKS: Stores task details and the developer assigned to each task.
The application uses these entities to manage task assignments and completion status.
Main Features
-
Create new tasks.
-
Assign tasks to developers.
-
Display developers with their total task counts.
-
Expand and collapse developer-wise task lists.
-
Display task completion checkboxes.
-
Mark tasks as completed or pending.
-
Delete tasks using a delete icon.
-
Dynamically generate the task interface using PL/SQL.
-
Apply custom CSS styling to task lists and checkboxes.
3. Application Architecture
The application uses Oracle APEX Page 6, named PL DYNAMIC PRINT.
The page contains two primary regions:
| Region | Purpose |
|---|---|
| Create Tasks | Provides the form for creating and assigning tasks |
| Tasks | Displays developers and their associated tasks dynamically |
The Create Tasks region contains the task entry fields, while the Tasks region generates a developer-wise list using PL/SQL.
Application Workflow
flowchart TD
A[Open Tasks Management Page] --> B[Enter Task Details]
B --> C[Select Developer]
C --> D[Click Add]
D --> E[Save Task in Database]
E --> F[Display Developer-wise Tasks]
F --> G[Expand Developer]
G --> H[View Assigned Tasks]
H --> I{User Action}
I -->|Mark Complete| J[Select Checkbox]
J --> K[Click Update]
K --> L[Update Completion Status]
I -->|Delete| M[Click Delete Icon]
M --> N[Delete Task]
4. Database Structure
The uploaded application export references two database tables: DEVELOPERS and TASKS.
The following columns are directly referenced in the application:
DEVELOPERS Table
| Column | Description |
|---|---|
| DEVELOPER_ID | Developer identifier |
| DEVELOPER_NAME | Developer name |
TASKS Table
| Column | Description |
|---|---|
| TASK_ID | Task identifier |
| TASK_TITLE | Task title |
| TASK_DESCRIPTION | Task description |
| DEVELOPER_ID | Assigned developer |
| COMPLETED | Task completion status |
The application uses the DEVELOPER_ID column to associate tasks with developers.
Note: The uploaded page export references these tables but does not contain their complete CREATE TABLE statements. Therefore, the table structures above represent the columns used by the application, not a complete database DDL definition.
5. Create Tasks β Task Entry Form
The first region is named Create Tasks.
It allows users to enter task information and assign the task to a developer.
The form contains the following page items:
| Page Item | Purpose |
|---|---|
| P6_TASK_ID | Task primary key |
| P6_TASK_TITLE | Enter task title |
| P6_TASK_DESCRIPTION | Enter task description |
| P6_DEVELOPER_ID | Select developer |
| P6_COMPLETED | Completion status |
Developer Selection LOV
The developer selection item uses a SQL List of Values to retrieve developer names from the DEVELOPERS table.
SELECT d.developer_name display_value,
d.developer_id return_value
FROM developers d;
This query displays the developer name to the user while storing the corresponding developer ID.
Add Task Button
The Add button submits the page and executes the form DML process.
The exported application contains a process named:
Add Task
Process Type: Automatic Row Processing (DML)
Execution Point: After Submit
The process is associated with the Create Tasks form region and inserts the submitted task record into the database.
This approach uses Oracle APEXβs built-in form processing capability instead of writing a separate INSERT statement manually.
6. Developer-Wise Dynamic Task Display
One of the main features of this application is the dynamic display of tasks grouped by developer.
The Tasks region uses a PL/SQL Dynamic Content source. It retrieves developers and their associated tasks and generates the HTML output using the HTP.P procedure.
The implementation uses two SYS_REFCURSOR variables:
-
C_DEVSβ Retrieves developer information. -
C_TASKSβ Retrieves the tasks associated with each developer.
Developer and Task Retrieval
The following query uses a nested cursor to retrieve each developer along with their assigned tasks.
OPEN c_devs FOR
SELECT
d.developer_id,
d.developer_name,
CURSOR (
SELECT task_title,
task_id,
completed
FROM tasks t
WHERE t.developer_id = d.developer_id
GROUP BY task_title,
task_id,
completed
) c_tasks
FROM developers d;
The outer query retrieves developer information, while the nested cursor retrieves the tasks assigned to the current developer.
This structure makes it possible to process developers and their tasks in separate nested loops.
Display Developer Information
For every developer, the application calculates the total number of assigned tasks.
SELECT COUNT(t.task_id)
INTO v_tasks_cnt
FROM tasks t
WHERE t.developer_id = v_developer_id;
The developer name and task count are then displayed using dynamic HTML.
HTP.P(
'<li class="dev-li">
<h4>' || v_dev_name ||
' <small>' || v_tasks_cnt || ' tasks</small></h4>'
);
This creates a developer heading with the total task count.
7. Display Tasks with Dynamic HTML
After displaying the developer information, the application generates a nested HTML list for the developerβs tasks.
The application uses HTP.P to generate HTML dynamically.
HTP.P('<ul class="tasks-ul">');
For every task, it generates a list item containing:
-
A completion checkbox.
-
Task title.
-
Delete icon.
The following code is taken from the applicationβs dynamic PL/SQL implementation:
HTP.P(
'<li class="tasks-li">' ||
APEX_ITEM.CHECKBOX2(
1,
v_task_id,
CASE
WHEN v_completed = 'Y'
THEN 'CHECKED'
ELSE NULL
END
) ||
' <label data-content="' || v_task_title ||
'" for="' || v_task_id || '">' ||
v_task_title ||
'</label>' ||
'<span data-id=' || v_task_id ||
' class="delete-task fa fa-trash"></span>' ||
'</li>'
);
How APEX_ITEM.CHECKBOX2 Works
The APEX_ITEM.CHECKBOX2 function dynamically generates a checkbox for each task.
Its arguments are:
-
1β Associates the checkbox values withAPEX_APPLICATION.G_F01. -
v_task_idβ Identifies the task associated with the checkbox. -
CHECKEDβ Checks the checkbox when the task is already completed.
When a user selects a checkbox and submits the page, the selected task IDs become available in the APEX_APPLICATION.G_F01 array.
This allows the application to identify which tasks should be marked as completed.
8. Custom CSS for Task Management Interface
The application uses inline CSS to create a clean and interactive task list.
Some of the main CSS classes are:
| CSS Class | Purpose |
|---|---|
.dev-ul |
Main developer list |
.dev-li |
Individual developer section |
.tasks-ul |
Nested task list |
.tasks-li |
Individual task row |
.delete-task |
Delete icon |
Expandable Developer Sections
The task list is initially hidden using:
.tasks-ul {
list-style: none;
margin-right: 5px;
margin-top: 0px;
display: none;
}
When a developer heading is clicked, JavaScript toggles the visibility of the nested task list.
Custom Checkbox Design
The application also uses custom CSS to style the task checkboxes.
.tasks-li [type="checkbox"] {
position: relative;
width: 1.5em;
height: 1.5em;
border: 1px solid #bdc1c6;
border-radius: 4px;
appearance: none;
outline: 0;
cursor: pointer;
transition: background 175ms cubic-bezier(0.1, 0.1, 0.25, 1);
}
When a checkbox is selected, the application changes its background and border color.
.tasks-li [type="checkbox"]:checked {
color: #fff;
border-color: #06842c;
background: #06842c;
}
The label also receives a line-through effect to visually indicate a completed task.
This improves the user experience by making completed and pending tasks easier to identify.
9. JavaScript for Expand and Collapse
The application uses JavaScript in the pageβs JavaScript Code on Load section.
The following code handles the expand and collapse functionality:
$('.dev-li').on('click', function(e) {
$(this).children('ul').toggle();
});
$('.tasks-ul').on('click', function(e) {
e.stopPropagation();
});
How It Works
-
The user clicks a developer heading.
-
JavaScript finds the nested task list.
-
The
toggle()method shows or hides the list. -
Clicking inside the task list does not trigger the parent developer click event because of
stopPropagation().
This creates an expandable developer-wise task interface without requiring a separate page for each developer.
10. Update Task Completion Status
The application provides an Update button to save task completion changes.
The process is named:
Update Tasks
Execution Point: After Submit
The process first resets all tasks to pending status and then updates the selected task IDs to completed.
PL/SQL Process
BEGIN
UPDATE tasks
SET completed = 'N';
FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
UPDATE tasks
SET completed = 'Y'
WHERE task_id =
TO_NUMBER(APEX_APPLICATION.G_F01(i));
END LOOP;
END;
Explanation
Step 1: Reset all tasks to N, meaning pending.
Step 2: Loop through the selected checkbox values in APEX_APPLICATION.G_F01.
Step 3: Convert each selected task ID to a number.
Step 4: Update the matching task record to Y, meaning completed.
This process ensures that the completion status in the database reflects the checkbox selections submitted by the user.
Important implementation consideration: This process updates all task records to pending before applying the selected values. In a multi-user application, this approach can affect tasks belonging to other users or developers. A production implementation should scope the update to the relevant task set or authorized records.
11. Delete Tasks Using JavaScript and PL/SQL
The application also provides a delete icon for every task.
Each delete icon contains the task ID in its data-id attribute.
<span data-id="TASK_ID"
class="delete-task fa fa-trash"></span>
When the user clicks the delete icon, JavaScript captures the task ID and submits the page with a DELETE request.
JavaScript Code
$('.delete-task').on('click', function() {
apex.submit({
request: 'DELETE',
validate: false,
set: {
"P6_DELETE": $(this).data('id')
}
});
});
The task ID is passed into the hidden page item:
P6_DELETE
Delete Tasks PL/SQL Process
The application contains a process named Delete Tasks.
BEGIN
DELETE FROM tasks
WHERE task_id = :P6_DELETE;
END;
The process runs when the page request equals DELETE.
Delete Workflow
-
User clicks the delete icon.
-
JavaScript retrieves the task ID.
-
The task ID is assigned to
P6_DELETE. -
The page submits with the
DELETErequest. -
The Delete Tasks process executes.
-
The matching task record is deleted from the TASKS table.
This provides a convenient way to remove tasks directly from the developer-wise task list.
12. Application Processes and Components
The following table summarizes the main processes and components identified in the uploaded Page 6 export.
| Component / Process | Type | Purpose |
|---|---|---|
| Create Tasks | Form Region | Enter task information |
| Tasks | PL/SQL Dynamic Content | Display developer-wise tasks |
| Add | Submit Button | Create a new task |
| Update | Submit Button | Save completion status |
| Add Task | Form DML | Insert task record |
| Update Tasks | PL/SQL | Update task completion |
| Delete Tasks | PL/SQL | Delete selected task |
| Initialize form PL DYNAMIC PRINT | Form Initialization | Initialize form |
| P6_DELETE | Hidden Item | Store task ID for deletion |
| APEX_ITEM.CHECKBOX2 | PL/SQL API | Generate task checkboxes |
13. Important Technical Considerations
When implementing this solution in a real business application, developers should consider the following improvements:
1. HTML Escaping
The application dynamically generates HTML using database values. User-entered task titles and developer names should be escaped using APEX_ESCAPE.HTML before being written into HTML. This helps prevent HTML injection and cross-site scripting.
2. Authorization and Access Control
Task updates and deletions should verify that the current user is authorized to modify the selected task. Do not rely only on the task ID submitted by the browser.
3. Transaction Handling
Use appropriate transaction handling and ensure that errors are reported properly. Avoid resetting unrelated task records when updating completion status.
4. Multi-User Support
If multiple users work on the application simultaneously, task updates should be restricted to the appropriate developer, project, or user scope.
5. Validation
Add server-side validation for required task titles, valid developer assignments, and valid completion values.
These improvements can make the application more suitable for production environments.
14. Business Use Cases
The same implementation approach can be used in several business scenarios:
-
Software Development Teams: Assign development tasks to individual developers and monitor completion.
-
IT Support Teams: Manage support activities and track resolved tasks.
-
Project Management: Organize work items by team member.
-
Internal Operations: Track daily activities and assigned responsibilities.
-
Departmental Workflows: Display pending and completed tasks for different employees.
The current implementation provides the foundation for these scenarios. Additional capabilities such as due dates, priorities, notifications, and dashboards can be added as future enhancements.
15. Conclusion
In this implementation, we explored how to build a developer-wise Tasks Management System using Oracle APEX, PL/SQL, SQL, JavaScript, and custom CSS.
The application demonstrates how to create and assign tasks, dynamically display tasks grouped by developer, calculate task counts, update completion status using APEX_APPLICATION.G_F01, and delete records through JavaScript and PL/SQL processes.
One of the key technical highlights is the use of SYS_REFCURSOR, nested cursors, HTP.P, and APEX_ITEM.CHECKBOX2 to generate a dynamic task interface directly from database records.
Oracle APEX provides several built-in components, but combining them with PL/SQL and JavaScript gives developers additional flexibility to build customized business applications.
This project is a practical example of how Oracle APEX can be used to develop lightweight task management solutions with database-driven functionality and an interactive user interface.
Oracle Solutions We believe in delivering tangible results for our customers in a cost-effective manner