Download presentation
Presentation is loading. Please wait.
Published byVerity Henderson Modified over 9 years ago
1
Eyad Alshareef 1 Creating Custom Forms Part A
2
2Eyad Alshareef Data Block and Custom Forms Data block form Data block form Based on data blocks that are associated with specific database tables Based on data blocks that are associated with specific database tables Reflect the structure of the database Reflect the structure of the database Custom form Custom form Based on control blocks that process data from multiple tables Based on control blocks that process data from multiple tables Reflect business processes rather than the database structure Reflect business processes rather than the database structure
3
3Eyad Alshareef Introduction to Custom Forms Custom form Custom form Displays data fields from variety of database tables Displays data fields from variety of database tables Contains programs that support organizational processes Contains programs that support organizational processes Use lists of values (LOVs) to retrieve data values Use lists of values (LOVs) to retrieve data values Manipulate data using form triggers Manipulate data using form triggers
4
4Eyad Alshareef Identifying the Business Processes and Database Operations Identify processes that form supports Identify processes that form supports Identify associated database tables Identify associated database tables Describe process Describe process
5
5Eyad Alshareef Designing the Interface Visualize how form will look Visualize how form will look
6
6Eyad Alshareef Creating a Custom Form Manually create form canvas in Object Navigator Manually create form canvas in Object Navigator Create form items by “painting” items on canvas Create form items by “painting” items on canvas Using tools on Layout Editor tool palette Using tools on Layout Editor tool palette Write code that controls form functions Write code that controls form functions
7
7Eyad Alshareef Creating the Form Canvas Manually create form canvas in Object Navigator Manually create form canvas in Object Navigator Start Forms Builder Start Forms Builder Create and rename form canvas Create and rename form canvas Rename form module and form window Rename form module and form window Change Title property of form window Change Title property of form window Perform in Visual View in Object Navigator Perform in Visual View in Object Navigator
8
8Eyad Alshareef Creating a Control Block Control data block Control data block Also called control block Also called control block Data block not associated with particular database table Data block not associated with particular database table Create new data block in Object Navigator Create new data block in Object Navigator Specify data block created manually Specify data block created manually Use Ownership View Use Ownership View
9
9Eyad Alshareef Creating the Form Items Create Create Boilerplate logo image and text Boilerplate logo image and text Form text items Form text items Command button items Command button items Display form in Layout Editor Display form in Layout Editor Draw items on form canvas using tools in tool palette Draw items on form canvas using tools in tool palette
10
10Eyad Alshareef Creating the LOVs LOV LOV Retrieve data from database table Retrieve data from database table Use LOV Wizard Use LOV Wizard Run form Run form To test LOV To test LOV
11
11Eyad Alshareef Displaying System Date and Time Values in Form Text Items System variable System variable Variable representing value always available to any form Variable representing value always available to any form Display value in text item automatically Display value in text item automatically Set text item’s Initial Value property Set text item’s Initial Value property
12
12Eyad Alshareef Forms Builder Date and Time System Variables
13
13Eyad Alshareef Creating Command Buttons Create and configure buttons Create and configure buttons Create form triggers associated with buttons Create form triggers associated with buttons
14
14Eyad Alshareef Creating and Configuring Command Buttons Draw button on canvas using Button tool Draw button on canvas using Button tool Button tool on tool palette Button tool on tool palette Button group Button group Buttons should all be same size Buttons should all be same size Wide enough to accommodate longest button’s label Wide enough to accommodate longest button’s label Draw button with longest label first Draw button with longest label first
15
15Eyad Alshareef Creating the Button Triggers Select Triggers node under button in Object Navigator Select Triggers node under button in Object Navigator Click Create button to create trigger Click Create button to create trigger Select trigger event Select trigger event Specify trigger code Specify trigger code WHEN-BUTTON-PRESSED button event WHEN-BUTTON-PRESSED button event Trigger code executes when user clicks button Trigger code executes when user clicks button
16
16Eyad Alshareef Creating the Button Triggers (continued) Reference form items: Reference form items: :block_name.item_name :block_name.item_name Clear form text items in form trigger: Clear form text items in form trigger: Use CLEAR_FORM built-in procedure Use CLEAR_FORM built-in procedure Create program unit to set value of text items to blank text string Create program unit to set value of text items to blank text string Procedure Procedure Code block that executes commands to change one or more values Code block that executes commands to change one or more values
17
17Eyad Alshareef Creating the Button Triggers (continued) Function Function Code block Code block Returns single value Returns single value Create program unit: Create program unit: Open Object Navigator Open Object Navigator Select Program Units node Select Program Units node Click Create button Click Create button Program unit does not use DECLARE keyword Program unit does not use DECLARE keyword
18
18Eyad Alshareef Creating a Custom Form 1. Create the form 2. Create the form window and canvas manually 3. Create a control block Data block that is not associated with a specific table Data block that is not associated with a specific table Contains form items that you manually draw on the canvas Contains form items that you manually draw on the canvas 4. Create form triggers to process data
19
19Eyad Alshareef Form Triggers Code that is associated with a form object and an event Code that is associated with a form object and an event Can contain SQL INSERT, UPDATE, DELETE, and SELECT commands Can contain SQL INSERT, UPDATE, DELETE, and SELECT commands Referencing form text item values in triggers: Referencing form text item values in triggers::block_name.item_name
20
20Eyad Alshareef Practice1 Create a custom form that has: Create a custom form that has: Employee Name Employee Name Employee Salary Employee Salary Department Name Department Name Create a LOV to retrieve block records Create a LOV to retrieve block records Use triggers to retrieve block records Use triggers to retrieve block records Create a button that calls a program unit to clear the block. Create a button that calls a program unit to clear the block.
21
21Eyad Alshareef Creating a custom form Create a new form module and name it COURSE Create a new form module and name it COURSE Click on data bloc and then on the plus icon. Select Build a data block manually Click on data bloc and then on the plus icon. Select Build a data block manually Rename your block into COURSE_BLOCK Rename your block into COURSE_BLOCK
22
22Eyad Alshareef Create and modify a canvas Add a canvas by clicking on Canvas in object navigator and then on a plus sign Add a canvas by clicking on Canvas in object navigator and then on a plus sign Rename your canvas into HEADER, and open it with Design Editor Rename your canvas into HEADER, and open it with Design Editor
23
23Eyad Alshareef Create and modify a canvas Change the background color of the canvas using the Property palette Change the background color of the canvas using the Property palette Add a header “Course Information” Add a header “Course Information” Add a picture (download any picture from the web, save in in C:\\temp, then go to Edit, Import) Add a picture (download any picture from the web, save in in C:\\temp, then go to Edit, Import)
24
24Eyad Alshareef Add text boxes and prompts Using the toolbox on the left, add Course Name text box and a corresponding prompt: Using the toolbox on the left, add Course Name text box and a corresponding prompt:
25
25Eyad Alshareef Add text boxes and prompts Using the toolbox, add a stacked canvas on COURSE canvas Using the toolbox, add a stacked canvas on COURSE canvas Name your canvas COURSE_ITEMS Name your canvas COURSE_ITEMS Add Room and Time text boxes and corresponding prompts to the COURSE_ITEMS canvas Add Room and Time text boxes and corresponding prompts to the COURSE_ITEMS canvas
26
26Eyad Alshareef Add control buttons Return to the main canvas Return to the main canvas Using toolbox on the left, add four control buttons. Using toolbox on the left, add four control buttons. Name them New, Find, Save and Clear Name them New, Find, Save and Clear
27
27Eyad Alshareef Adding PL/SQL code Create triggers for each of the buttons Create triggers for each of the buttons Add PL/SQL code to the triggers Add PL/SQL code to the triggers
28
28Eyad Alshareef Adding PL/SQL code
29
29Eyad Alshareef Adding PL/SQL code Create triggers for each of the buttons Create triggers for each of the buttons Add PL/SQL code to the triggers Add PL/SQL code to the triggers
30
30Eyad Alshareef Adding PL/SQL code Create triggers for each of the buttons Create triggers for each of the buttons Add PL/SQL code to the triggers Add PL/SQL code to the triggers
31
31Eyad Alshareef Adding PL/SQL code Create triggers for each of the buttons Create triggers for each of the buttons Add PL/SQL code to the triggers Add PL/SQL code to the triggers
32
32Eyad Alshareef Form Trigger Properties Trigger activated Trigger activated In response to event such as clicking button In response to event such as clicking button Trigger name defines event that activates it Trigger name defines event that activates it
33
33Eyad Alshareef Trigger Categories
34
34Eyad Alshareef Trigger Timing Specifies when trigger fires Specifies when trigger fires PRE- PRE- Fire just before event successfully completes Fire just before event successfully completes POST- POST- Fire just after event successfully completes Fire just after event successfully completes ON-,WHEN-, and KEY- ON-,WHEN-, and KEY- Fire in response to actions Fire in response to actions
35
35Eyad Alshareef Trigger Scope Defines where event must occur in order for associated trigger to fire Defines where event must occur in order for associated trigger to fire Includes object to which trigger attached Includes object to which trigger attached And objects within trigger object And objects within trigger object
36
36Eyad Alshareef Trigger Execution Hierarchy Defines which trigger fires Defines which trigger fires When object within form object contains same trigger that form object contains When object within form object contains same trigger that form object contains By default trigger in higher-level object overrides trigger in lower-level object By default trigger in higher-level object overrides trigger in lower-level object Can specify custom execution hierarchy Can specify custom execution hierarchy
37
37Eyad Alshareef Directing Form External Navigation External navigation External navigation User causes form focus to change by making different form item active User causes form focus to change by making different form item active Form focus Form focus Item currently selected on form Item currently selected on form Internal navigation Internal navigation Result of internal form code that responds to external navigation operations or trigger commands Result of internal form code that responds to external navigation operations or trigger commands
38
38Eyad Alshareef Setting the Form Tab Order Set tab order Set tab order Place items in correct order under Items node Place items in correct order under Items node In Object Navigator window In Object Navigator window
39
39Eyad Alshareef Directing External Navigation Using Built-in Subprograms Built-in subprograms Built-in subprograms Called built-ins Called built-ins Use to direct external form navigation Use to direct external form navigation Cannot use in navigational triggers Cannot use in navigational triggers
40
40Eyad Alshareef Built-in Subprograms to Control External Navigation
41
41Eyad Alshareef User Action Triggers Fired Result on User Screen Display User starts form PRE-FORM PRE-BLOCK Form appears, but with no data visible WHEN-NEW-FORM-INSTANCE WHEN-NEW-BLOCK-INSTANCE WHEN-NEW-RECORD-INSTANCE WHEN-NEW-ITEM-INSTANCE Form is available for use Triggers That Fire at Form Startup 1 2 3 4 5
42
42Eyad Alshareef User Action Triggers Fired Result on User Screen Display User places the insertion point in a text item WHEN-NEW-ITEM-INSTANCE Insertion point appears in item WHEN-NEW-RECORD-INSTANCE WHEN-NEW-ITEM-INSTANCE Next record appears User clicks the Next Record button Triggers That Fire as a Result Of External Navigation
43
43Eyad Alshareef User ActionTriggers Fired Result on User Screen Display User closes the Forms Runtime window Forms Runtime window closes POST-BLOCK POST-FORM Triggers That Fire When a Form Closes
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.