500 likes | 683 Views
Chapter 5. Introduction To Form Builder. Lesson A. Lesson A Objectives. Display Forms Builder forms in a Web browser Use a data block form to view, insert, update, and delete database data Create a data block form that displays a single record at a time
E N D
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, and delete database data • Create a data block form that displays a single record at a time • Use the Object Navigator to change form object names • Use the Data Block and Layout Wizards to modify form properties • Create a tabular-style data block form that displays multiple records
Forms • Why Do We Use Form Builder? • Why Don’t We Use SQL Only?!
Forms • You have learned to use SQL commands to insert, update, delete, and view database data • Users can’t interact with a database by creating SQL queries • Users use database applications called forms to be able to interact with a database
Forms • Application with a graphical user interface that looks like a paper form • Used to insert, update, delete and view database data
Forms • Programmers uses the Forms Builder utility to create forms • Forms Builder is a part of the Oracle Developer Suite 10g
Data Block Form • Is a form associated with a specific Oracle database table
Displaying Forms in A Web Browser • Developer 10g displays forms as Web pages in a web browser • The form appears in the Forms Services window within the browser window • The Forms Services application displays menus and a toolbar that provide general functions for all form applications
Architecture of the World Wide Web • The World Wide Web consists of networked computers on the Internet • Some of the computers act as servers, and other computers act as clients • Today, almost any computer can be both a client and a server at the same time
Architecture of the World Wide Web • On the Web, users work on client-side computers that are connected to the Internet, and use programs called Web browsers to access information on the Internet
Web Servers • Are computers that are connected to the Internet and run special Web server software • They store the files that people can access via the Internet using a browser • They listen for messages that are sent to the server from client browsers, then read them and send the requested Web page back across the Internet to the user’s browser
How Forms Builder Displays a Form in a Browser • To create a dynamic Web page that displays database data, database application developers specify the form’s contents, appearance, and functionality in Forms Builder • When they run the form, the Forms Builder system translates the design specification into Java applet
How Forms Builder Displays a Form in a Browser • Java Applet • Is a self-contained Java program that runs in a Web browser’s generic Java run-time environment • Java: is a full-featured, object-oriented programming language that programmers use to create many different kinds of applications • Most popular Web browsers support a generic Java run-time environment that executes Java commands and displays Java objects on Web pages
How Forms Builder Displays a Form in a Browser • Forms Builder uses a Web server process called an OC4J Instance to translate the form design specification into a Java applet
Displaying a Forms Builder Form Using a Web Browser • When you are developing forms, your workstation runs both the Web server and the Web browser in its main memory • Then, when you run a form, the Forms Builder development environment compiles the form design file (.fmb) into (.fmx) and sends it to the OC4J Instance • OC4J Instance translates the compiled (.fmx) file into a Java applet, and then downloads it to your Web browser
Using a Data Block Form • A block is a group of related form items such as text fields and option buttons • A data blockcorresponds to a specific database table, and contains objects such as text fields and option buttons, that display values from the table’s data fields. • A data block form contains one or more data blocks • The most common block items are text items, which display text data values in text field
Using a Data Block Form • A single-block form: is the form that displays data from only one table • A multiple-block form: is the form that displays data from multiple database tables
Data Block Form File Types • .fmb • Form design file, used by form programmer in Form Builder • .fmx • Form executable file, run by form users
Expected Errors • If the error “FRM-90928” appears, it means that the path name or the form name contains space. • If the web page does not appear and the browser displays the characters http://%%20 or similar. Then the form builder should be configured correctly to use your web browser.
Forms Services Window • Within the browser window, the Java applet displays the Forms Services window • It has: • A form menu that contains selections that allow you to manipulate the form • A toolbar with buttons that you can use to insert, view, modify and delete records • A message line at the bottom that displays error or status messages, and a status line which reports how many records the current query has retrieved
Forms Services Window • The Query button group allows you to query data • The Navigation button group allows you to navigate among different records and different blocks • The Action query button group inserts, deletes, and locks records
Form Modes • When the form is running in the Forms Services window in the web browser it can be one of two modes: • Normal Mode • You can view records, sequentially step through the records, and change data values • Enter Query Mode • You can enter a search expression in one of the form fields, and then retrieve the associated records
Using a Form to View Table Records • In the Enter Query Mode: • You can retrieve specific table records by typing a search expression in one or more of the form text items, and then execute the query • Or, you can retrieve all of the records in a table by executing the query without typing a search expression
Form Search Types • Exactsearch: only retrieves records that exactly match the entered search condition • Inexactsearch: retrieves records containing data values that fall within a range of values or contain partial text strings
Inexact Search Operators • _ : wildcard replacing a single character • % : wildcard replacing multiple characters • >, < : greater than, less than • >=, <= : greater than or equal to, less than or equal to • <> or != : not equal to
Using a Form to Insert, Update, and Delete Records • You can use a form to perform the DML operations of inserting, updating, and deleting records
Viewing and Interpreting Form Errors • When a user makes an error while entering form data, an error code and message appear in the message line • Some errors are detected or trapped within the form, and the form issues the error message • Other errors are not detected until the form sends the data values to the database, so the Oracle DBMS issues the error message
Creating a Data Block Form • When you create a data block form, Forms Builder automatically: • Generates the text items and labels for data fields in that table • Then, provides the code for inserting, modifying, deleting, and viewing data records
The Object Navigator • The Object Navigator window displays Forms Builder objects and their underlying components as a hierarchical tree • The Forms Builder toolbar is available with the Object Navigator window as it is with all Forms Builder windows
The Object Navigator • The Object Navigator tree represents objects as nodes • The top level Forms Builder objects are Forms, Menus, PL/SQL Libraries, Object Libraries, Built-in Packages, and Database Objects • When you open a form, its node appears under the Forms node, and is called a form module
Form Components • Window • Is the familiar rectangular area on a computer screen that has a title bar at the top • Windows usually have horizontal and vertical scroll bars, and they usually can be resized, maximized, and minimized • In Form Builder forms, you can specify window properties, such as title, size, and position on the screen • Canvas • Is the area in a window in which you place graphical user interface (GUI) objects, such as buttons and text fields • Data block
Form Components Window Canvas Name Block Cash Check Credit Card
Form Components • A form can contain one or more windows • A window can have multiple canvases • A canvas can have multiple blocks • Individual items within a block can appear on different canvases
Creating a New Data Block Form • After you create a new form module, you need to: • Create the data block that associates the form with a database table • Specify the form layout which specifies how the form appears to the user • You can create the data block first, and then specify the layout properties
Creating a New Data Block Form • You have the option of creating the data block manually or using the Data Block Wizard • Data Block Wizard is a tool that allows you to specify the data block’s properties
Data Block Wizard Pages • Welcome Page • Introduces the data Block Wizard • Type Page • Specify whether the data block’s data comes from a database table, a database view, or a stored procedure • Table Page • Select the database table that provides the data for the data block • Select the specific table field that you include in the block, and whether you want to enforce integrity constraints in the form application
Data Block Wizard Pages • Name Page • Specify the name of the data block as it appears in the Object Navigator tree • Finish Page • Presents the option of immediately starting the Layout Wizard to specify the form layout properties after creating the data block
Creating the Form Layout • The form layout specifies how a given form looks to the user • Form Layout Components: • Data block fields • Field labels • Number of records appear at one time • Form frame title • You can use the Layout Wizard to specify the form layout properties
Layout Wizard Pages • Welcome Page • Introduce the Layout Wizard • Canvas page • Specifies the canvas on which the form objects appear • Canvas types: • Content Canvas – fills the entire window • Stacked Canvas – Contains multiple canvases that are stacked on top of one another, and you can display or hide to change the appearance of the canvas as needed • Toolbar Canvas – has horizontal or vertical toolbars that program commands can display or hide • Tab Canvas – enable different related canvases to appear on a single tab page
Layout Wizard Pages • Data Block page • Select the fields that are displayed on the form • Items page • Specify the prompts, widths, and heights for the form text items • A prompts is the label that describes the data value that appears in the associated text field • Style page • Specify the layout style and properties • Layout Styles: • Form style - One record appears on the form at a time • Tabular style - Multiple records display on the form in a table
Layout Wizard Pages • Rows Page • The title that appears on the frame that encloses the data block items • The number of rows that appear in a tabular-style layout • Whether a tabular-style layout displays a scroll bar • Finish Page • Signals that the layout is complete
The Layout Editor • The Layout Editor provides a graphical display of the form canvas • You use Layout Editor to draw and position form items, and to add boilerplate objects such as labels, titles, and graphic images • Boilerplate Objects don’t contribute directly to the form’s functionality, but enhance its appearance
Object Navigator • Object Navigator Views • Ownership view: shows form objects as a flat list (the form is presented as a top-level object, and then lists all form object nodes on the next level) . • Visual view: hierarchical relationships between objects ( form objects contain other objects: a form contains windows, a window contains canvases and a canvas contains data blocks).
Modifying Forms Using the Data Block Wizard and Layout Wizard • Data Block Wizard and Layout Wizard are reentrant, which means that you can use them to modify the properties of an existing data block or layout