Transcript
Page 1: Oracle Application Express (APEX)

Oracle Application Express (APEX)

Project Implementation for COSC 5050 Distributed Database Applications

Lab5

Page 2: Oracle Application Express (APEX)

APEX Forms with ProcedureUse of procedures

Insert Form on procedure

Update Form on procedure Fetch record Database fields definition

Delete Button for process Process on PL/SQL

Page 3: Oracle Application Express (APEX)

Use of ProcedureUse of procedure for insert, update, and

deleteThree stored procedures

ADD_HT_EMPUPD_HT_EMPDEL_HT_EMP

We will create form page on a procedure

Page 4: Oracle Application Express (APEX)

Form for Creating EmployeeCreating a form on a

procedureCreate page Form

Form on a procedureProcedure name:

ADD_HT_EMPPage name: HT

Employee ProcBreadcrumb:

BreadcrumbBreadcrumb parent

entry: HT Employee report

Page 5: Oracle Application Express (APEX)

Form for Creating EmployeeTab options

Use an existing tab set and reuse an existing tab within that tab set

Tab set: TS1 (Home, Department, Employee…)Tab label: HT Employee report

Page 6: Oracle Application Express (APEX)

Form for Creating EmployeeInvoking page: HT Employee (Report)

Button label: Add New EmployeeButton region: ReportButton position: Bottom of regionBranching on submit and cancel: HT Employee

(Report)

Page 7: Oracle Application Express (APEX)

Form for Creating EmployeeSelect procedure arguments

Include all argumentsModify labels accordinglySelect display type accordingly

Page 8: Oracle Application Express (APEX)

Form for Creating EmployeeConfirmation and finish

Page 9: Oracle Application Express (APEX)

Form for Creating EmployeeFurther customization

Need to label required fieldsNeed validations for required fieldsNeed to create LOV for department and

managerDate format

Page 10: Oracle Application Express (APEX)

Form for Creating EmployeeCreate validation for required fields

Page processing Validating right click Validations Create

Validation level: Page itemIdentify the page item: first name (or last

name)

Page 11: Oracle Application Express (APEX)

Form for Creating EmployeeCreate validation for required fields

Name: first name not nullError display location: Inline in notificationValidation type: Not nullError message: First name is required.Then Create

Page 12: Oracle Application Express (APEX)

Form for Updating EmployeeCreating a form on a procedure for updating

employeeCreate page Form Form on a procedureProcedure name: UPD_HT_EMPPage name: HT Employee Proc UpdateBreadcrumb parent entry: HT Employee

(Report)Tab options

Use an existing tab set and reuse an existing tab within that tab set

Tab set: TS1 Use tab: HT Employee report

Page 13: Oracle Application Express (APEX)

Form for Updating EmployeeCreating a form on a procedure for updating

employeeInvoking page: {none}(will invoke from report

page)Button label: {none}(will invoke from report page)Branching

On submit and cancel: HT Employee (Report)Select procedure arguments

Modify labels accordingly Select display type accordingly Keep the EMP_ID_IN

Page 14: Oracle Application Express (APEX)

Form for Updating Employee

Page 15: Oracle Application Express (APEX)

Form for Updating EmployeeEdit or create the link on the report page to

invoke the update form pageEdit the update form page for fetching record

Add a data manipulation process for page rendering

In Page rendering pane, under before header processes Right click Processes Create Data manipulation Automated row fetch

Name: fetch record Table name: HT_EMP Item containing PK column value: P??_P_ID_IN Primary key column: EMP_ID

Page 16: Oracle Application Express (APEX)

Form for Updating Employee

Page 17: Oracle Application Express (APEX)

Form for Updating EmployeeEmployee ID needs be hidden and protected

Page 18: Oracle Application Express (APEX)

Form for Updating EmployeeEdit each attribute item so item value can be

fetchedDefine database column

Edit item Source section Source used: Always, replacing any existing value in

session sate Source type: Database column Source value or express: {table column name} (case

sensitive)

Page 19: Oracle Application Express (APEX)

Form for Updating Employee

Page 20: Oracle Application Express (APEX)

Form for Deleting EmployeeEditing the form for deleting employeeCreate a button for delete

Right click Region buttons CreateButton name: DELETELabel: DeletePosition: Region template position #DELETE#Action: Submit page(Optional) condition: Value of item / column in

expression 1 is not null Expression 1: P??_P_ID_IN

Page 21: Oracle Application Express (APEX)

Form for Deleting Employee

Page 22: Oracle Application Express (APEX)

Form for Deleting EmployeeUpdate branching action:

Right click the branch Go to page ??Conditions section

When button pressed: No button condition

Page 23: Oracle Application Express (APEX)

Form for Deleting EmployeeAdd delete confirmation:

javascript:confirmDelete('Are you sure?','DELETE');

Page 24: Oracle Application Express (APEX)

Form for Deleting EmployeeCreate a process for delete

Under page processing paneRight click Processes Create PL/SQLName: Run DEL_HT_EMPPL/SQL page process: DEL_HT_EMP(:P??

_P_ID_IN);(Optional) Success and error messagesWhen button pressed: DELETE


Top Related