chapter 5

Post on 15-Feb-2016

40 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Chapter 5

Introduction To Form Builder

Lesson A

2

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 records3

Forms

Why Do We Use Form Builder? Why Don’t We Use SQL Only?!

4

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

5

Forms

6

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

7

Data Block Form

8

Is a form associated with a specific Oracle database table

Displaying Forms in A Web Browser

9

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

10

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

11

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

12

Web Servers

13

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

14

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

15

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

16

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

17

Displaying a Forms Builder Form Using a Web Browser

18

Using a Data Block Form

19

A block is a group of related form items such as text fields and option buttons

A data block corresponds 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

20

Data Block Form File Types

21

.fmb Form design file, used by form programmer in

Form Builder .fmx

Form executable file, run by form users

Expected Errors

22

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

23

Forms Services Window

24

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

25

Form Modes

26

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

27

Form Search Types

28

Exact search: only retrieves records that exactly match the entered search condition

Inexact search: retrieves records containing data values that fall within a range of values or contain partial text strings

Inexact Search Operators

29

_ : 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

30

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

31

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

32

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

33

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

34

The Object Navigator

35

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

36

Form Components

37

Name

Cash

Check

Credit Card

Window

Canvas

Block

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

38

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

39

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

40

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

41

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

42

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

43

Layout Wizard Pages

44

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

45

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

46

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

47

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).

Object Navigator

48

Object Navigator

49

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

50

top related