A Guide to Oracle9i1 Creating Custom Forms Chapter 6.

Slides:



Advertisements
Similar presentations
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Advertisements

A Guide to Oracle9i1 Creating and Modifying Database Tables Chapter 2.
A Guide to Oracle9i1 Creating Database Reports Chapter 7.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
The Web Warrior Guide to Web Design Technologies
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
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.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Chapter 5B-C: Introduction to Forms Builder: Tiggers, LOV.
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?!
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
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.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
XP Chapter 7 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Enhancing User Interaction Through Programming Chapter.
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 7Automating, Customizing, and.
Enhancing User Interaction Through Programming
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
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.
1 JavaScript in Context. Server-Side Programming.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
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.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
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.
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.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
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 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
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
Introduction to Triggers
Chapter 6: Creating Custom Forms
Producing Triggers Schedule: Timing Topic 40 minutes Lecture
Creating Additional Input Items
Presentation transcript:

A Guide to Oracle9i1 Creating Custom Forms Chapter 6

A Guide to Oracle9i2 Lesson A Objectives Learn about custom forms Create a custom form Create command buttons that use form triggers to manipulate data Use the Forms Debugger to find form logic and runtime errors Learn how form triggers work Create form navigation triggers

A Guide to Oracle9i3 Custom Forms Display the data fields from a variety of database tables Contain programs that support organizational processes Not associated with one table When creating custom forms: –Identify the processes that the form is intended to support, then identify the associated database tables. –Helpful to draw interface on paper

A Guide to Oracle9i4 Creating a Custom Form Manually create the form canvas in the Object Navigator Create the form items by “painting” the items on the canvas, using tools on the Layout Editor tool palette Write the code that controls the form functions Use a control data block –Not associated with one database table –Contains manually drawn form items –Controlled with form triggers

A Guide to Oracle9i5 System Date and Time Variables

A Guide to Oracle9i6 Creating Command Buttons Create a command button by drawing the button on the canvas using the Button tool Create button triggers manually for custom forms Trigger fires on WHEN-BUTTON-PRESSED event If multiple buttons execute similar actions (like clearing a form) create a separate program unit for this action

A Guide to Oracle9i7 Sample Button Trigger Commands

A Guide to Oracle9i8 Using the Forms Debugger to Find Runtime Errors Use the Forms Debugger to find runtime errors that occur while a form is running Identify the program line that is causing the error, and examine the variable values used within the command that has the error Investigate the nature of the error by looking up the error code explanation –Error codes with the FRM- prefix are Forms Builder error codes –Error codes with the ORA- prefix are generated by the DBMS Look up error code on otn.oracle.com

A Guide to Oracle9i9 Using the Forms Debugger Click the Run Form Debug button on the Forms Builder toolbar Set a breakpoint, which pauses execution on a specific program command To debug: –Examine the current values of all program variables –Step through the program commands to observe the execution path –Examine variable values to see how the values change

A Guide to Oracle9i10 Setting a Breakpoint

A Guide to Oracle9i11 Forms Debug Console Windows

A Guide to Oracle9i12 Viewing Text Item Values

A Guide to Oracle9i13 Form Trigger Categories

A Guide to Oracle9i14 Trigger Properties Trigger timing: –Specifies when a trigger fires –Can be just before, during, or after its triggering event –Before: PRE- –After: POST- –During: WHEN-, ON-, KEY- Trigger scope –Defines where an event must occur in order for trigger to fire –Includes the object to which the trigger is attached, and contained objects

A Guide to Oracle9i15 Trigger Properties Trigger execution hierarchy: –Defines which trigger fires when an object within a form object contains the same trigger that the form object contains –Can specify custom execution hierarchy

A Guide to Oracle9i16 Directing Form External Navigation Form focus: currently selected item has form focus External navigation: –Occurs when the user causes the form focus to change by making a different form item active Internal navigation: –Occurs as a result of internal form code that responds to external navigation operations or trigger commands Use external navigation to: –Specify initial form focus when form opens –Specify tab order

A Guide to Oracle9i17 Setting Tab Order in Object Navigator

A Guide to Oracle9i18 Directing External Navigation Using Built-in Subprograms

A Guide to Oracle9i19 Lesson B Objectives Learn about default system messages and how to suppress them Create alerts and messages to provide system feedback Create applications that avoid user errors Learn how to trap common runtime errors

A Guide to Oracle9i20 System Message Severity Levels

A Guide to Oracle9i21 Suppressing Messages SYSTEM.MESSAGE_LEVEL: –Variable used to suppress error messages –Set to 0, 5, 10, 15, 20, 25 to suppress all messages with severity below this level –Default value is 0 –Set value in PRE-FORM trigger

A Guide to Oracle9i22 Providing System Feedback Custom message: –A short text string displayed on the form message line –Use when the form needs to provide a short, simple message that does not require an acknowledgement from the user –To create: MESSAGE('message_string'); –Can be up to 200 characters

A Guide to Oracle9i23 Alerts Dialog box that can display a longer text message Displays one or more buttons that allow the user to select between alternatives that execute associated program statements Use when: –Message is longer than 200 characters –User acknowledgement is required –User choice is required See Figure 6-22 for example alert

A Guide to Oracle9i24 Displaying an Alert In a form trigger: DECLARE alert_button NUMBER; BEGIN alert_button := SHOW_ALERT('alert_name'); END; Use ELSIF structure to interpret and act on user response

A Guide to Oracle9i25 Avoiding User Errors Forms should help users avoid errors by: –Validating input values –Programmatically disabling form command buttons –Disabling navigation for form text items containing values that users should not change

A Guide to Oracle9i26 Text Item Validation

A Guide to Oracle9i27 Form Validation Triggers Item validation triggers: –Perform complex validations –Associate with WHEN-VALIDATE-ITEM event –Trigger code tests the current item value to determine if it satisfies the validation condition –If input not valid, form displays a message and raises a built-in exception named FORM_TRIGGER_FAILURE

A Guide to Oracle9i28 Disabling Form Command Buttons Disable command buttons to prevent users from pressing them before form is in proper state SET_ITEM_PROPERTY('UPDATE_BUTTON ', ENABLED, PROPERTY_FALSE);

A Guide to Oracle9i29 Disabling Text Item Navigation Prevent users from modifying primary key values Make text item nonnavigable: –user cannot press the Tab key to place the insertion point in the text item To prevent user clicking item: –Create a trigger that moves the insertion point to another form item whenever the user clicks the text item using the mouse

A Guide to Oracle9i30 Trapping Common Runtime Errors Provide better error messages for common errors Create form-level trigger for ON-ERROR event

A Guide to Oracle9i31 Syntax for ON-ERROR Trigger

A Guide to Oracle9i32 Lesson C Objectives 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

A Guide to Oracle9i33 Converting a Data Block to a Control Block Save time by creating a data block and converting to a control block To convert data block to control block: –Change the data block’s Database Data Block property value to No –Change the Required property value of the text item that represents the data block table’s primary key to No

A Guide to Oracle9i34 Linking a Data Block to a Control Block Useful in complex forms with master-detail relationships Master is control block, details are data blocks To link a control block with a data block: –Create the control block –Create the data block –Specify the link between the control block and the data block –Modify the form triggers to refresh the data block when the underlying data values change

A Guide to Oracle9i35 Control/Data Block Form Example

A Guide to Oracle9i36 Creating Forms with Multiple Canvases Use multiple screens to avoid displaying too much information Single-form approach: –Create one form with multiple canvases –Enables the form to share data among the different canvases –Impossible for multiple programmers to work simultaneously on different canvases of the same application Multiple-form approach: –Create multiple forms with a different.fmb file for each application canvas –Works well when multiple programmers collaborate to create a complex application

A Guide to Oracle9i37 Viewing Canvas and Block Information

A Guide to Oracle9i38 Creating Multiple Canvas/Block Forms Specify block and canvas ordering in Object Navigator To navigate to another canvas programmatically, use GO_ITEM to navigate to an item on the canvas Refer to items in triggers with syntax :block_name.item_name Use caution to make sure items are placed in correct blocks

A Guide to Oracle9i39 Creating and Configuring Tab Canvases in Forms Multiple-page canvases that allow users to move between multiple canvas surfaces by selecting tabs at the top of the canvas. Use to: –Display a large number of related items in a modular way –Direct a user through a sequence of steps for performing a task Lies on top of a content canvas within the form window. Tab page: –An object representing a surface that displays form items –Has a tab label identifier at the top

A Guide to Oracle9i40 Creating a Tab Canvas To create: –Create the form –Create a new content canvas in the form –Create a tab canvas on the content canvas –Configure the tab pages

A Guide to Oracle9i41 Creating a Tab Canvas

A Guide to Oracle9i42 Creating and Configuring Stacked Canvases in Forms Lies on top of a content canvas Use to hide canvas objects and then make the objects appear as needed Create by: –Painting canvas in the desired position on an existing content canvas –Configure stacked canvas properties –Create the form items that are to appear –Write form triggers that contain commands to display the stacked canvas when it is needed and to hide the stacked canvas when it is not needed

A Guide to Oracle9i43 Configuring a Stacked Canvas

A Guide to Oracle9i44 Summary Control blocks are created manually and do not represent data from only one table Control blocks can be created from data blocks to make coding easier Forms Debugger is used to find runtime errors in forms User errors should be avoided by limiting opportunities for error User feedback is presented in message line and alert boxes A form may contain more than one canvas; canvases can be organized using tabs or shown and hidden programmatically