520 likes | 650 Views
Introduction To Form Builder . Part A. Forms. Application with a graphical user interface that looks like a paper form Used to insert, update, delete and view database data. Primary Form Uses. Viewing/retrieving records Inserting/updating/deleting records
E N D
Introduction To Form Builder Part A Eyad Alshareef
Forms • Application with a graphical user interface that looks like a paper form • Used to insert, update, delete and view database data Eyad Alshareef
Primary Form Uses • Viewing/retrieving records • Inserting/updating/deleting records • Counting the number of records a query will retrieve Eyad Alshareef
Data Block Forms • Form associated with a specific Oracle database table (object) • System automatically creates: • Text fields associated with table fields • Programs for inserting, modifying, deleting, and viewing data records Eyad Alshareef
Data Block Forms • ORACLE 10g forms are displayed on web browser as a web page. • They are displayed in Forms Services Window. • The form specification is translated into Java Applet. • They are Dynamic Web Pages. Eyad Alshareef
Displaying Forms in a Web Browser • Developer10g displays forms as Web pages • In Web browser • Form appears in Forms Services window within browser window • Forms Services application displays menus and toolbar • Provide general functions for all form applications Eyad Alshareef
Architecture of the World Wide Web • Web browsers (IE, Mozilla, Foxfire) • Web servers • Web page • Static (always displays the same information ) • Dynamic (the content varies based on user inputs or data retrieved from external resources ) • Forms Builder form • Dynamic Web page • Derives content from Oracle 10g database Eyad Alshareef
How Forms Builder Displays a Form in a Browser • Java applet • Self-contained Java program that runs in a web browser generic java runtime environment • OC4J Instance • Translates compiled .fmx file into Java applet • Downloads Java applet to Web browser Eyad Alshareef
Using a Data Block Form • Block • Group of related form items • Data block • Corresponds to specific database table • Contains objects that display values from table’s data fields • Text items • Form menu • Contains selections to manipulate form Eyad Alshareef
Using a form to view table record Eyad Alshareef
Form Modes • Normal • You can view records and sequentially step through records • Enter Query • You can enter search parameters in form fields and then retrieve the associated records • To place the form in Enter Query mode, click the Enter Query button Eyad Alshareef
Forms Services Window • Form menu contains selections that allow you to manipulate the form • Has a toolbar with buttons to insert, view, modify, and delete records • At bottom of the window are lines that display information about form status Eyad Alshareef
Forms Services Window Eyad Alshareef
Inserting New Records • In Normal mode, click the Insert Record button to insert a new blank record • Type the data values in the form fields • Click the Save button to save the values in the database Eyad Alshareef
Retrieving Records • Click the Enter Query button to place the form in Enter Query mode • Type a search condition • Click the Execute Query button to retrieve selected records • If you click , do not enter a search condition, and then click , all table records will be retrieved Eyad Alshareef
Form Search Types • Exact search: only retrieves records that exactly match the entered search condition • Restricted search: retrieves records that fall within a range of values Eyad Alshareef
Restricted 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 Eyad Alshareef
Scrolling Through Retrieved Records • To view the next record, click the Next Record button • To view the previous record, click the Previous Record button Eyad Alshareef
Updating and Deleting Records • Retrieve the record to be updated or deleted • To update, change the data value and click the Save button • To delete, click the Remove Record button Eyad Alshareef
Closing a Form and Committing Changes • To close a form: • Click Exit button • Click Action on the form menu and then click Exit • Close browser window • If unsaved changes exist, dialog box will prompt to save changes Eyad Alshareef
Creating Data Block Form Eyad Alshareef
Start Oracle Form Builder Eyad Alshareef
Start OC4J Instance Eyad Alshareef
Creating a new form • Create a new module • Create a data block • Create a layout Eyad Alshareef
Data Block Form File Types • .fmb • Form design file, used by form programmer in Form Builder • .fmx • Form executable file, run by form users Eyad Alshareef
Creating a Data Block Form • When creating a form for a table, Forms Builder automatically creates: • Labels • Text entry fields • Insert, update and delete and select queries Eyad Alshareef
The Object Navigator Eyad Alshareef
The Object Navigator • Displays Forms Builder objects and underlying components • As hierarchical tree • Forms Builder toolbar displays buttons • Form module • Object node • + indicates lower-level objects • - indicates node expanded fully Eyad Alshareef
Form Components • Form module: form application • Form window • Title bar on top • Horizontal and vertical scrollbars • Can be resized, maximized, minimized Eyad Alshareef
Form Components • Canvas • Surface that displays form items • Block • Object that contains form items • Form items • Command buttons, radio (option) buttons, text items • Items in the same block can appear on different canvases Eyad Alshareef
Form Components Window Canvas Name Block of items Cash Check Credit Card Eyad Alshareef
Creating a New Data Block Form • Create a new form module • Create a new data block using: • Data block wizard • Manual process • Using Data Block Wizard: • Select table name • Move editable fields from Available Columns list to Database Items list • Use Layout Wizard to create form layout Eyad Alshareef
Layout Editor • Use to customize form display • Can add images and static text to enhance form appearance Eyad Alshareef
Layout Editor Eyad Alshareef
Creating a Data Block Form • Steps: 1. Create the data block using the Data Block Wizard 2. Create the form layout using the Layout Wizard Eyad Alshareef
Data Block Wizard • Welcome page • Type page • Select table or view on which to base the block source • Table page • Select table associated with form • Enforce Integrity Constraint Check Box • Finish page • Option to use the Layout Wizard to automate creating the layout Eyad Alshareef
Layout Wizard • Canvas page • Select the canvas where the block is displayed • Data Block page • Select the fields that are displayed on the layout • Items page • Specify the column labels, heights and widths • Style page • Specify to create a form- or tabular-style layout Eyad Alshareef
Layout Styles • Form style • One record appears on the form at a time • Tabular style • Multiple records display on the form in a table Eyad Alshareef
Create a new form based on MODULE1 • Go to File/New/Form – a new module is added to your object navigator window • Click on MODULE2 and rename it into STUDENT Eyad Alshareef
Create a data block based on a table • Right click on the STUDENT module and select Data Block Wizard • Click next on the Data Block Wizard welcome page Eyad Alshareef
Creating a data block (cont’s) • Select Table/view option • Select a table by clicking on Browse button Eyad Alshareef
Selecting a table (cont’d) • When you click browse, you will be prompted to log in • Login into your usual account and select table STUDENT from the displayed list Eyad Alshareef
Select database items • Move all the attributes into selected attributes pane using arrow buttons Eyad Alshareef
Name your data block Eyad Alshareef
Select the “… then call the Layout wizard” option Eyad Alshareef
Creating a layout • Layout wizard allows you to create a form layout • Click next on the welcome page and select content canvas type Eyad Alshareef
Select items to be displayed • Select items to be displayed • Modify the labels (prompts) and widths of corresponding text boxes if necessary Eyad Alshareef
Select a layout • Select form layout • Name the frame • Select the number of students to be displayed Eyad Alshareef
Complete and view the form • Complete and view the form design Eyad Alshareef
Form Builder Wizards Are Re-entrant • You can select a block or layout, then re-enter it and modify its properties using the Wizard • A Wizard is in re-entrant mode when its pages appear as tabs Eyad Alshareef