Eyad Alshareef 1 Creating Custom Forms Part B. 2Eyad Alshareef Lesson B Objectives After completing this lesson, you should be able to: Suppress default.

Slides:



Advertisements
Similar presentations
A Guide to Oracle9i1 Creating Custom Forms Chapter 6.
Advertisements

Decision Analysis Tools in Excel
Creating Custom Reports. 2 Design and create a custom report You can easily create custom reports based on a table or query. There are seven sections.
Enhanced Guide to Oracle 10g
Chapter 6: Creating Custom Forms. Data Block and Custom Forms Data block form Based on data blocks that are associated with specific database tables Reflect.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros
A Guide to Oracle9i1 Advanced Forms Builder Topics Chapter 10.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Chapter 5B-C: Introduction to Forms Builder: Tiggers, LOV.
Eyad Alshareef 1 Creating Custom Forms Part A. 2Eyad Alshareef Data Block and Custom Forms Data block form Data block form Based on data blocks that are.
Introduction To Form Builder
Introduction To Form Builder
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Access Tutorial 10 Automating Tasks with Macros
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Copyright Ó Oracle Corporation, All rights reserved. 55 Working with Data Blocks and Frames.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
Forms - An Overview of Oracle Form Builder v.6.0 Abhishek Parag Prashant Arun.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
1 Chapter 12: Form Builder Objects and Flexible Code.
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
XP Chapter 4 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Collecting Data for Well-Designed Forms Chapter 4 “Making.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
Eyad Alshareef 1 Introduction To Form Builder Part B.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 2 Modifying a Table and Creating.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
CHAPTER 6 LESSON B Creating Custom Forms. Lesson B Objectives  Suppress default system messages  Create alerts and messages to provide system feedback.
Modify Tables and FieldsModify Tables and Fields Lesson 4 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft.
Key Applications Module Lesson 22 — Managing and Reporting Database Information Computer Literacy BASICS.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Quick Test Professional 9.2. Testing Process Preparing to Record Recording Enhancing a Test Debugging Running the Test and Analyzing the Results Reporting.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Chapter 6 Lesson C Creating Custom Forms. Lesson C Objectives Convert data blocks to control blocks Link data blocks to control blocks Create a form that.
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
Formatting a Research Paper Lesson 10 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
DB Implementation: MS Access Forms. MS Access Forms: Purpose Data entry, editing, & viewing data in Tables Forms are user-friendlier to end-users than.
Chapter 7: Creating Custom Forms. Data Block and Custom Forms Data block form Based on data blocks that are associated with specific database tables Reflect.
CHAPTER 7 LESSON B Creating Database Reports. Lesson B Objectives  Describe the components of a report  Modify report components  Modify the format.
Eyad Alshareef, Edited by: Mostafa Ali
Forms Concepts Triggers Fired when Internal/External events occur
Working with Data Blocks and Frames
Working in the Forms Developer Environment
Developer 2000 CSE 4504/6504 Lab.
Creating LOVs and Editors
Building a User Interface with Forms
DB Implementation: MS Access Forms
Chapter 6: Creating Custom Forms
DB Implementation: MS Access Forms
Producing Triggers Schedule: Timing Topic 40 minutes Lecture
Creating a Master-Detail Form
Introduction To Form Builder
Creating Additional Input Items
Presentation transcript:

Eyad Alshareef 1 Creating Custom Forms Part B

2Eyad Alshareef Lesson B Objectives After completing this lesson, you should be able to: Suppress default system messages Suppress default system messages Create alerts and messages to provide system feedback to users Create alerts and messages to provide system feedback to users Create applications that avoid user errors Create applications that avoid user errors Trap common runtime errors Trap common runtime errors

3Eyad Alshareef Controlling System Messages Forms Services message line Forms Services message line Displays FRM- and ORA- messages Displays FRM- and ORA- messages Classified according to Classified according to Severity Severity Whether or not they require user intervention Whether or not they require user intervention Suppress default system messages Suppress default system messages Replace with custom messages Replace with custom messages Set :SYSTEM.MESSAGE_LEVEL variable Set :SYSTEM.MESSAGE_LEVEL variable In PRE-FORM trigger In PRE-FORM trigger

4Eyad Alshareef Oracle Error Message Severity Levels 5: informative message (one record saved) 5: informative message (one record saved) 10: informative message advising user of procedural error (cannot insert character ) 10: informative message advising user of procedural error (cannot insert character ) 20: condition that keeps trigger from working correctly 20: condition that keeps trigger from working correctly 25 condition that keeps form from working correctly 25 condition that keeps form from working correctly >25: extreme severity (out of memeory) >25: extreme severity (out of memeory)

5Eyad Alshareef Providing System Feedback Important application design principle Important application design principle Provide users with feedback about what is happening in application Provide users with feedback about what is happening in application Make applications forgiving Make applications forgiving Allow users to undo unintended operations Allow users to undo unintended operations

6Eyad Alshareef Suppressing Lower Level System Messages Set :SYSTEM.MESSAGE_LEVEL variable to a higher level in PRE-FORM trigger Set :SYSTEM.MESSAGE_LEVEL variable to a higher level in PRE-FORM trigger :SYSTEM.MESSAGE_LEVEL := 25;

7Eyad Alshareef Providing User Feedback in Forms  Message  Text in message line at bottom of form  Informational only; user doesn't have to respond  Alert  Dialog box  Allows user to choose different ways to proceed

8Eyad Alshareef Messages Message Syntax: Syntax: MESSAGE(‘message text’);

9Eyad Alshareef Custom Messages Short text string that displayed on form message line Short text string that displayed on form message line Up to 200 characters Up to 200 characters Syntax: Syntax: MESSAGE('message_string'); MESSAGE('message_string');

10Eyad Alshareef Alerts Form-level object Form-level object Object properties define alert appearance Object properties define alert appearance Title Style icon Message Buttons

11Eyad Alshareef Alerts Dialog box Dialog box Display text message longer than 200 characters Display text message longer than 200 characters Displays one or more buttons Displays one or more buttons Allow user to select between alternatives that execute associated program statements Allow user to select between alternatives that execute associated program statements Top-level form object Top-level form object

12Eyad Alshareef Alerts (continued) Styles: Styles: Note Note Caution Caution Stop Stop Button Label property determines: Button Label property determines: How many buttons appear on alert How many buttons appear on alert Labels on buttons Labels on buttons Maximum 3 buttons Maximum 3 buttons

13Eyad Alshareef Alerts (continued) Create alert from Alert Navigation node Create alert from Alert Navigation node To declare/display alert: To declare/display alert:DECLARE alert_button NUMBER; BEGINalert_button:= SHOW_ALERT('alert_name'); END;

14Eyad Alshareef Example Alert

15Eyad Alshareef Syntax to Display an Alert and Execute Alternate Commands Depending on the Button the User Clicked

16Eyad Alshareef Avoiding User Errors Help users avoid errors Help users avoid errors Configure forms that validate input values Configure forms that validate input values Programmatically disable form command buttons Programmatically disable form command buttons Disable navigation for form text items containing values that users should not change Disable navigation for form text items containing values that users should not change

17Eyad Alshareef Validating Form Input Values Validate input values Validate input values Ensure that values meet specific preset requirements Ensure that values meet specific preset requirements Use Use Text item validation properties Text item validation properties Form validation triggers Form validation triggers Validation unit Validation unit Represents largest chunk of data that user can enter before form validates all input values Represents largest chunk of data that user can enter before form validates all input values

18Eyad Alshareef Text Item Validation Properties

19Eyad Alshareef Validating Form Input Values (continued) Item validation trigger Item validation trigger Item-level trigger Item-level trigger Associate with item’s WHEN-VALIDATE-ITEM event Associate with item’s WHEN-VALIDATE-ITEM event Fires when item validated Fires when item validated As determined by form validation unit As determined by form validation unit If not valid If not valid Raises built-in exception named FORM_TRIGGER_FAILURE Raises built-in exception named FORM_TRIGGER_FAILURE

20Eyad Alshareef Disabling Form Command Buttons to Avoid User Errors Enable or disable button while form running: Enable or disable button while form running: SET_ITEM_PROPERTY('item_name', property_name, property_value); SET_ITEM_PROPERTY('item_name', property_name, property_value);

21Eyad Alshareef Validation Triggers When Validate Item When Validate Item It should be Item level trigger. It should be Item level trigger. Executes when the item validation occurs depending on Validation Unit property. Executes when the item validation occurs depending on Validation Unit property. E.g. : E.g. : IF NOT :student.s_class IN (‘FR’,’SO’) THEN Message(‘Legal Values are FR and SO); RAISE FORM_TRIGGER_FAILURE; END IF;

22Eyad Alshareef How To Disable Buttons SET_ITEM_PROPERTY SET_ITEM_PROPERTY E.g. : E.g. : SET_ITEM_PROPERTY(‘Control.Delete’, ENABLED, PROPERTY_FALSE);

23Eyad Alshareef Disabling Text Item Navigation Nonnavigable Nonnavigable User cannot press Tab key to place insertion point in text item User cannot press Tab key to place insertion point in text item Set item’s Keyboard Navigable property to No Set item’s Keyboard Navigable property to No User can still click mouse pointer in text item to enter value User can still click mouse pointer in text item to enter value Create trigger that moves insertion point to another form item Create trigger that moves insertion point to another form item WHEN-MOUSE-UP event WHEN-MOUSE-UP event

24Eyad Alshareef Trapping Form Runtime Errors ON-ERROR event occurs ON-ERROR event occurs Whenever ORA- or FRM- error occurs while form running Whenever ORA- or FRM- error occurs while form running Create form-level trigger that corresponds to ON-ERROR event Create form-level trigger that corresponds to ON-ERROR event Use decision control structure to handle different errors Use decision control structure to handle different errors

25Eyad Alshareef Forms Builder Built-in Procedures for Handling Errors

26Eyad Alshareef Lesson C Objectives After completing this lesson, you should be able to: Convert data blocks to control blocks Convert data blocks to control blocks Link data blocks to control blocks Link data blocks to control blocks Create a form that has multiple canvases Create a form that has multiple canvases Create tab canvases Create tab canvases Create stacked canvases Create stacked canvases

27Eyad Alshareef Data Blocks vs. Control Blocks Data block Data block Easy to create and use Easy to create and use Is associated with a single table, and reflects the table’s structure Is associated with a single table, and reflects the table’s structure Control block Control block Requires a lot of custom programming Requires a lot of custom programming Can contain items from many different tables Can contain items from many different tables You can link data and control blocks to take advantages of the strengths of each You can link data and control blocks to take advantages of the strengths of each

28Eyad Alshareef Converting a Data Block to a Control Block Use Data Block and Layout Wizards to create data block form and form layout Use Data Block and Layout Wizards to create data block form and form layout Convert data block to control block Convert data block to control block Add command buttons to control form processing Add command buttons to control form processing Simplify creation of control blocks Simplify creation of control blocks

29Eyad Alshareef Converting a Data Block to a Control Block Create a data block and layout that contains most of the required text items Create a data block and layout that contains most of the required text items Convert the data block to a control block by changing the following block property: Convert the data block to a control block by changing the following block property: Database Data Block = No Database Data Block = No Then change the following text property: Then change the following text property: Required = No Required = No

30Eyad Alshareef Linking a Data Block to a Control Block Create forms that link data blocks and control blocks to work together Create forms that link data blocks and control blocks to work together Usually represent master-detail relationship Usually represent master-detail relationship

31Eyad Alshareef Linking Data Blocks and Control Blocks 1. Create the control block as the master block 2. Create the data block as the detail block, but do not create a master-detail relationship 3. Create a master-detail relationship manually in the WHERE Clause property of the detail block: data_block_field = :control_block.text_item

32Eyad Alshareef Creating the Data Block Use Data Block Wizard and Layout Wizards Use Data Block Wizard and Layout Wizards To create and configure data block To create and configure data block Must contain field that links it to control block Must contain field that links it to control block Create data block without master-detail relationship Create data block without master-detail relationship Link two blocks later Link two blocks later

33Eyad Alshareef Linking the Control Block and the Data Block Open detail data block’s Property Palette Open detail data block’s Property Palette Modify data block’s WHERE Clause property Modify data block’s WHERE Clause property General syntax: General syntax: fieldname := control_block.text_item_name fieldname := control_block.text_item_name

34Eyad Alshareef Displaying and Refreshing the Data Block Values Create a trigger to: Create a trigger to: Place the insertion point in the data block Place the insertion point in the data blockGO_BLOCK(‘data_block_name’); Flush the data block to make its data consistent with the master block and the database: Flush the data block to make its data consistent with the master block and the database:EXECUTE_QUERY;

35Eyad Alshareef Refreshing the Data Block Values Add commands to: Add commands to: Initially populate data block display Initially populate data block display Periodically refresh data block records Periodically refresh data block records Use the GO_BLOCK built-in: Use the GO_BLOCK built-in: To move form focus to data block To move form focus to data block Then execute EXECUTE_QUERY built-in Then execute EXECUTE_QUERY built-in Flushes block Flushes block Makes information consistent with corresponding database data Makes information consistent with corresponding database data

36Eyad Alshareef Creating Forms with Multiple Canvases Good practice not to show too much information on user’s screen display Good practice not to show too much information on user’s screen display Single-form approach Single-form approach Create one form with multiple canvases Create one form with multiple canvases Enables form to share data among different canvases Enables form to share data among different canvases Impossible for multiple programmers to work simultaneously on different canvases of same application Impossible for multiple programmers to work simultaneously on different canvases of same application

37Eyad Alshareef Creating a Form with Multiple Canvases Users should be able to see all canvas text items without scrolling Users should be able to see all canvas text items without scrolling For complex applications with many text items, divide application into multiple canvases For complex applications with many text items, divide application into multiple canvases

38Eyad Alshareef Block Navigation Order First block in Object Navigator Data Blocks list determines block items that first appear when form opens First block in Object Navigator Data Blocks list determines block items that first appear when form opens Users can use the Tab key to navigate among different block items Users can use the Tab key to navigate among different block items Canvas that contains block items automatically appears Canvas that contains block items automatically appears

39Eyad Alshareef Block Navigation Order Block order Canvas order doesn’t matter

40Eyad Alshareef Working with Multiple Canvases and Data Blocks Create form that contains multiple canvases Create form that contains multiple canvases Create individual canvases Create individual canvases Specify to display specific block items on specific canvas Specify to display specific block items on specific canvas Create new data block Create new data block Select canvas name on which block items appear Select canvas name on which block items appear On Layout Wizard Canvas page On Layout Wizard Canvas page

41Eyad Alshareef Working with Multiple Canvases and Data Blocks (continued) Often forms that have multiple canvases also have multiple data blocks Often forms that have multiple canvases also have multiple data blocks Group items that appear on same canvas in single data block Group items that appear on same canvas in single data block To keep blocks small and manageable To keep blocks small and manageable Cannot create two items that have same name in same data block Cannot create two items that have same name in same data block Ensure that Forms Builder places new items in correct block Ensure that Forms Builder places new items in correct block

42Eyad Alshareef Specifying the Block Navigation Order Specify which canvas initially appears when user runs form Specify which canvas initially appears when user runs form Canvas whose block items appear first under Data Blocks node in Object Navigator window Canvas whose block items appear first under Data Blocks node in Object Navigator window Order of canvases in Object Navigator Canvases list does not matter Order of canvases in Object Navigator Canvases list does not matter Only order of data blocks Only order of data blocks

43Eyad Alshareef Referencing Different Canvases, Form Blocks, and Block Items All form items have Canvas property All form items have Canvas property Specifies name of canvas on which item appears Specifies name of canvas on which item appears Form always displays canvas on which item with focus appears Form always displays canvas on which item with focus appears Execute GO_ITEM built-in Execute GO_ITEM built-in Move form focus to item on target canvas Move form focus to item on target canvas Good practice to include block name Good practice to include block name

Eyad Alshareef 44 Tap Canvas

45Eyad Alshareef Canvas It is the surface that has the form items on it. It is the surface that has the form items on it. It has many types: It has many types: Content (The default) Content (The default) Tab Tab Stacked Stacked … All canvases inside some window must have the property ‘Window’ has the name of the enclosing window. All canvases inside some window must have the property ‘Window’ has the name of the enclosing window.

46Eyad Alshareef Tab Canvases Multiple-page canvases that allow users to move among different canvas surfaces by clicking tabs Multiple-page canvases that allow users to move among different canvas surfaces by clicking tabs

47Eyad Alshareef Tab Canvas Components Tab canvas Tab canvas Collection of related tab pages Collection of related tab pages Tab pages Tab pages Surfaces that display form items Surfaces that display form items Tab labels Tab labels Identifier at top of tab page Identifier at top of tab page A tab canvas lies on top of a content canvas A tab canvas lies on top of a content canvas

48Eyad Alshareef Creating a Tab Canvas Use the Tab Canvas tool on the Layout Editor tool palette to draw a tab canvas on an existing content canvas Use the Tab Canvas tool on the Layout Editor tool palette to draw a tab canvas on an existing content canvas By default, a new tab canvas has 2 tab pages By default, a new tab canvas has 2 tab pages Create new tab pages as needed Create new tab pages as needed Adjust tab page properties Adjust tab page properties

49Eyad Alshareef Important Tab Page Properties Name: how the page Is referenced in the form Label: Caption that appears on the associated tab

50Eyad Alshareef Adjusting the Tab Page Order Tab page that appears first is tab page whose block items appear first in the Object Navigator Tab page that appears first is tab page whose block items appear first in the Object Navigator Block order Tab page order doesn’t matter

51Eyad Alshareef Creating and Configuring Tab Canvases in Forms Tab canvases Tab canvases Multiple-page canvases Multiple-page canvases Allow users to move between multiple canvas surfaces Allow users to move between multiple canvas surfaces By selecting tabs at top of canvas By selecting tabs at top of canvas Display large number of related items in modular way Display large number of related items in modular way Direct user through sequence of steps for performing task Direct user through sequence of steps for performing task

52Eyad Alshareef Creating a Tab Canvas Contains two or more tab pages Contains two or more tab pages Tab page Tab page Object representing surface Object representing surface Displays form items Displays form items Has tab label identifier at top Has tab label identifier at top

53Eyad Alshareef Creating Form Items on a Tab Canvas Use tab pages as any content canvas Use tab pages as any content canvas Create items on tab pages Create items on tab pages Using Data Block Wizard Using Data Block Wizard By creating control block and drawing text items directly on tab canvases By creating control block and drawing text items directly on tab canvases Must be sure to specify placement of items on tab canvas Must be sure to specify placement of items on tab canvas

Eyad Alshareef 54 Stacked Canvas

55Eyad Alshareef Stacked Canvases Canvas that appears on an existing content canvas, and can be displayed or hidden as needed Canvas that appears on an existing content canvas, and can be displayed or hidden as needed Allows user to configure canvas items Allows user to configure canvas items

56Eyad Alshareef Stacked Canvas Example Stacked canvas Content canvas

57Eyad Alshareef Creating a Stacked Canvas Use the Stacked Canvas tool on the Layout Editor tool palette to draw a stacked canvas on an existing content canvas Use the Stacked Canvas tool on the Layout Editor tool palette to draw a stacked canvas on an existing content canvas Create block items on the stacked canvas Create block items on the stacked canvas Create buttons and triggers to display and hide the stacked canvas Create buttons and triggers to display and hide the stacked canvas

58Eyad Alshareef Displaying and Hiding a Stacked Canvas Displaying a stacked canvas: Displaying a stacked canvas: GO_BLOCK(‘stacked_canvas_block’); SHOW_VIEW(‘stacked_canvas’); Hiding a stacked canvas: Hiding a stacked canvas: GO_BLOCK(‘content_canvas_block’); HIDE_VIEW(‘stacked_canvas’);

59Eyad Alshareef Lesson C Summary Convert data block to control block Convert data block to control block Create relationship between control block and data block Create relationship between control block and data block Display information on multiple canvases: Display information on multiple canvases: Single-form approach Single-form approach Multiple-form approach Multiple-form approach Tab canvas Tab canvas Multiple-page canvas Multiple-page canvas