Chapter 6: Creating Custom Forms

Slides:



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

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.
Chapter 5: Introduction to Forms Builder. 2 Lesson A Objectives After completing this lesson, you should be able to: Display Forms Builder forms in a.
13 Copyright © 2004, Oracle. All rights reserved. Introduction to Triggers.
A Guide to Oracle9i1 Advanced Forms Builder Topics Chapter 10.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Chapter 5B-C: Introduction to Forms Builder: Tiggers, LOV.
Chapter 7: Creating Database Reports
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Eyad Alshareef 1 Creating Custom Forms Part B. 2Eyad Alshareef Lesson B Objectives After completing this lesson, you should be able to: Suppress default.
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.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction To Form Builder
Introduction To Form Builder
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
14 Copyright © 2004, Oracle. All rights reserved. Producing Triggers.
Access Tutorial 10 Automating Tasks with Macros
23 Copyright © 2004, Oracle. All rights reserved. Sharing Objects and Code.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
Enhancing User Interaction Through Programming
Using Visual Basic 6.0 to Create Web-Based Database Applications
Forms - An Overview of Oracle Form Builder v.6.0 Abhishek Parag Prashant Arun.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
University of Sunderland COM 220 Lecture Six Slide 1 Building Interactive Forms Applications using Oracle.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
1 Chapter 12: Form Builder Objects and Flexible Code.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
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.
1 R. Ching, Ph.D. MIS Area California State University, Sacramento Week 4 February 15 LOV: List of ValuesLOV: List of Values Dealing with Errors and ProblemsDealing.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
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.
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,
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.
Excel Tutorial 8 Developing an Excel Application
Running a Forms Developer Application
Eyad Alshareef, Edited by: Mostafa Ali
Forms Concepts Triggers Fired when Internal/External events occur
Working with Data Blocks and Frames
Chapter 2: The Visual Studio .NET Development Environment
Working in the Forms Developer Environment
Developer 2000 CSE 4504/6504 Lab.
Creating LOVs and Editors
Building a User Interface with Forms
Run Time Messages and Alerts + Query Triggers
Working in the Form Builder Environment
Introduction to Triggers
Microsoft Access Illustrated
Using Procedures and Exception Handling
Using JDeveloper.
DB Implementation: MS Access Forms
Producing Triggers Schedule: Timing Topic 40 minutes Lecture
Creating Noninput Items
Creating a Master-Detail Form
Chapter 8: Creating An Integrated Database Application
Creating Additional Input Items
Navigation Schedule: Timing Topic 45 minutes Lecture
Presentation transcript:

Chapter 6: Creating Custom Forms Guide to Oracle 10g

Lesson A Objectives After completing this lesson, you should be able to: Create and use custom forms Create command buttons that use form triggers to manipulate data Use the Forms Debugger to find form logic and runtime errors Work with form triggers Create form navigation triggers Guide to Oracle 10g

Introduction to Custom Forms Displays data fields from variety of database tables Contains programs that support organizational processes Use lists of values (LOVs) to retrieve data values Manipulate data using form triggers Guide to Oracle 10g

Identifying the Business Processes and Database Operations Identify processes that form supports Identify associated database tables Describe process Guide to Oracle 10g

Designing the Interface Visualize how form will look Guide to Oracle 10g

Creating a Custom Form Manually create form canvas in Object Navigator Create form items by “painting” items on canvas Using tools on Layout Editor tool palette Write code that controls form functions Guide to Oracle 10g

Creating the Form Canvas Manually create form canvas in Object Navigator Start Forms Builder Create and rename form canvas Rename form module and form window Change Title property of form window Perform in Visual View in Object Navigator Guide to Oracle 10g

Creating a Control Block Control data block Also called control block Data block not associated with particular database table Create new data block in Object Navigator Specify data block created manually Use Ownership View Guide to Oracle 10g

Creating the Form Items Create Boilerplate logo image and text Form text items Command button items Display form in Layout Editor Draw items on form canvas using tools in tool palette Guide to Oracle 10g

Creating the LOVs LOV Use LOV Wizard Run form Retrieve data from database table Use LOV Wizard Run form To test LOV Guide to Oracle 10g

Displaying System Date and Time Values in Form Text Items System variable Variable representing value always available to any form Display value in text item automatically Set text item’s Initial Value property Guide to Oracle 10g

Forms Builder Date and Time System Variables Guide to Oracle 10g

Creating Command Buttons Create and configure buttons Create form triggers associated with buttons Guide to Oracle 10g

Creating and Configuring Command Buttons Draw button on canvas using Button tool Button tool on tool palette Button group Buttons should all be same size Wide enough to accommodate longest button’s label Draw button with longest label first Guide to Oracle 10g

Creating the Button Triggers Select Triggers node under button in Object Navigator Click Create button to create trigger Select trigger event Specify trigger code WHEN-BUTTON-PRESSED button event Trigger code executes when user clicks button Guide to Oracle 10g

Creating the Button Triggers (continued) Reference form items: :block_name.item_name Clear form text items in form trigger: Use CLEAR_FORM built-in procedure Create program unit to set value of text items to blank text string Procedure Code block that executes commands to change one or more values Guide to Oracle 10g

Creating the Button Triggers (continued) Function Code block Returns single value Create program unit: Open Object Navigator Select Program Units node Click Create button Program unit does not use DECLARE keyword Guide to Oracle 10g

Using the Forms Debugger to Find Runtime Errors Error that does not keep program from compiling Generates error while program running Often result of user error Retrieve error messages associated with errors Forms Debugger Step through triggers and other PL/SQL programs one line at a time Examine variable values during program execution Guide to Oracle 10g

Retrieving FRM- Error Messages Investigate nature of error by looking up error code explanation Oracle Technology Network (OTN) Web site FRM- prefix Forms Builder error codes ORA- prefix Generated by the DBMS Guide to Oracle 10g

Using the Forms Debugger Click Run Form Debug button Set breakpoint Pauses execution on specific program command Examine current values of all program variables Step through program commands to observe execution path Examine variable values to see how values change Guide to Oracle 10g

Using the Forms Debugger (continued) Breakpoint Pauses execution on specific command Set on: Program lines that contain executable program commands SQL queries To set: Double-click mouse pointer in gray shaded area on left side of PL/SQL Editor window Guide to Oracle 10g

Using the Forms Debug Console Control form execution and examine form values Buttons: Go Step Into Step Over Step Out Execution arrow Shows program line to execute next Guide to Oracle 10g

Forms Debug Console Guide to Oracle 10g

Debug Console Windows Guide to Oracle 10g

Form Trigger Properties Trigger activated In response to event such as clicking button Trigger name defines event that activates it Guide to Oracle 10g

Trigger Categories Guide to Oracle 10g

Trigger Timing Specifies when trigger fires PRE- POST- Fire just before event successfully completes POST- Fire just after event successfully completes ON-,WHEN-, and KEY- Fire in response to actions Guide to Oracle 10g

Trigger Scope Defines where event must occur in order for associated trigger to fire Includes object to which trigger attached And objects within trigger object Guide to Oracle 10g

Trigger Execution Hierarchy Defines which trigger fires 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 Can specify custom execution hierarchy Guide to Oracle 10g

Directing Form External Navigation User causes form focus to change by making different form item active Form focus Item currently selected on form Internal navigation Result of internal form code that responds to external navigation operations or trigger commands Guide to Oracle 10g

Setting the Form Tab Order Set tab order Place items in correct order under Items node In Object Navigator window Guide to Oracle 10g

Directing External Navigation Using Built-in Subprograms Called built-ins Use to direct external form navigation Cannot use in navigational triggers Guide to Oracle 10g

Built-in Subprograms to Control External Navigation Guide to Oracle 10g

Lesson A Summary Custom form Runtime errors Forms Debugger Displays data fields from variety of database tables Processes data using triggers that contain SQL commands Runtime errors Errors that occur while form running Forms Debugger Create breakpoints that pause execution Guide to Oracle 10g

Lesson A Summary Form triggers support: Block processing Interface events Master-detail processing Message handling Navigational events Query processing Transaction processing Validation Guide to Oracle 10g

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

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

Providing System Feedback Important application design principle Provide users with feedback about what is happening in application Make applications forgiving Allow users to undo unintended operations Guide to Oracle 10g

Custom Messages Short text string that displayed on form message line Up to 200 characters Syntax: MESSAGE('message_string'); Guide to Oracle 10g

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

Alerts (continued) Styles: Button Label property determines: Note Caution Stop Button Label property determines: How many buttons appear on alert Labels on buttons Maximum 3 buttons Guide to Oracle 10g

Alerts (continued) To declare/display alert: DECLARE alert_button NUMBER; BEGIN alert_button:= SHOW_ALERT('alert_name'); END; Guide to Oracle 10g

Example Alert Guide to Oracle 10g

Syntax to Display an Alert and Execute Alternate Commands Depending on the Button the User Clicked Guide to Oracle 10g

Avoiding User Errors Help users avoid errors Configure forms that validate input values Programmatically disable form command buttons Disable navigation for form text items containing values that users should not change Guide to Oracle 10g

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

Text Item Validation Properties Guide to Oracle 10g

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

Disabling Form Command Buttons to Avoid User Errors Enable or disable button while form running: SET_ITEM_PROPERTY('item_name', property_name, property_value); Guide to Oracle 10g

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

Generating Runtime Errors Deliberately generate errors while updating and deleting records View error messages Guide to Oracle 10g

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

Forms Builder Built-in Procedures for Handling Errors Guide to Oracle 10g

General Syntax for an ON-ERROR Trigger Guide to Oracle 10g

Lesson B Summary Create custom messages and alerts Provide feedback to users Validate user inputs using Text item validation properties Form validation trigger Guide to Oracle 10g

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

Converting a Data Block to a Control Block Use Data Block and Layout Wizards to create data block form and form layout Convert data block to control block Add command buttons to control form processing Simplify creation of control blocks Guide to Oracle 10g

Converting a Data Block to a Control Block (continued) To convert data block to control block: Change data block’s Database Data Block property value to No Change Required property value of text item that represents data block table’s primary key to No Guide to Oracle 10g

Linking a Data Block to a Control Block Create forms that link data blocks and control blocks to work together Usually represent master-detail relationship Guide to Oracle 10g

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

Linking the Control Block and the Data Block Open detail data block’s Property Palette Modify data block’s WHERE Clause property General syntax: fieldname := control_block.text_item_name Guide to Oracle 10g

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

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

Creating Forms with Multiple Canvases (continued) Multiple-form approach Create multiple forms with different .fmb file for each application canvas Works well when multiple programmers collaborate to create complex application Enables programmers to use form in many different applications More difficult for related forms to share data Guide to Oracle 10g

The Northwoods University Student Services Process Identify sequence of actions that user will employ to interact with canvases Guide to Oracle 10g

Interface Design Student Log On canvas Menu canvas Student Information canvas Course Grades canvas Enrollment canvas Guide to Oracle 10g

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

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

Specifying the Block Navigation Order Specify which canvas initially appears when user runs form 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 Only order of data blocks Guide to Oracle 10g

Object Navigator Guide to Oracle 10g

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

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

Creating a Tab Canvas Contains two or more tab pages Tab page Object representing surface Displays form items Has tab label identifier at top Guide to Oracle 10g

Creating a Tab Canvas (continued) Create form that contains tab canvas Create form Create new content canvas in form Create tab canvas on content canvas Configure tab pages Guide to Oracle 10g

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

Lesson C Summary Convert data block to control block Create relationship between control block and data block Display information on multiple canvases: Single-form approach Multiple-form approach Tab canvas Multiple-page canvas Guide to Oracle 10g

Summary Custom form Runtime errors Forms Debugger Form triggers Create custom messages and alerts Validate user inputs Guide to Oracle 10g

Summary (continued) Convert a data block to a control block Create relationship between control block and data block Display information on multiple canvases Tab canvas Guide to Oracle 10g