Form Builder Manual

download Form Builder Manual

of 97

Transcript of Form Builder Manual

  • 8/10/2019 Form Builder Manual

    1/97

    PRINCESULTANUNIVERSITY

    2012

    Oracle 10g: FormsBuilder I

    IS 333 Information Systems Development

    Prepared by: Ms. Ghada Al-Mazroa | Supervised by: Ms. Roohi Jan

    C O M P U T E R & I N F O R M A T I O N S C I E N C E S D E P A R T M E N T . C O L L E G E F O R W O M E N

  • 8/10/2019 Form Builder Manual

    2/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 2

    Oracle 10g: Forms Builder I 2012

    Table of ContentsHow to Start Oracle Form Builder ...................................................... .....................................4

    How does Forms Builder translate the form designer specification into a Java Applet ?........... 7

    Exploring the Form Builder ........................................................ .............................................8

    What is an Object Navigator? ...................................................................................................... 8

    Definitions ................................................................................................................................. 10

    Types of views ........................................................................................................................... 11

    How to view a Form in a Run mode? ........................................................................................ 12

    How to view information on database errors? ......................................................................... 13

    Modifying FORM Properties ...................................................................................................... 14

    Intersection mode ................................................................................................................. 16

    Layout editor after changing the properties ......................................................................... 17

    Ensuring a Consistent Appearance Across Form Modules ..................................... ................. 20

    Why it is important to maintain a consistent look and feel? .................................................... 20

    Two ways to standardize the appearance of multiple forms in an application: ....................... 20

    Template Forms ..................................................... ....................................................... ....... 20

    Steps to create the template form ............................................................................................ 20

    Visual Attribute Groups .................................................... .................................................... 36

    Steps to create visual attribute group for form text items ....................................................... 36

    Creating a Form Based on a Template Form ................................................ .......................... 40

    Steps to create a new form using the template ........................................................................ 40

    Applying The Visual Attribute Group to The Form Text Items ...................... .......................... 53

    Steps to apply the visual attribute group .................................................................................. 53

    Referencing Application Components ................................................ ................................... 58

    Using the Path Specification Approach ..................................................................................... 58

    Global Path Variable .............................................................................................................. 58

    Opening and Closing Forms in an Integrated Database Application ........................................ 59

    Steps to create a Home Page form using the template ............................................................ 59

    Opening forms in an Integrated Database Application ............................................................. 65

    CALL_FORM ........................................................................................................................... 65

    OPEN_FORM .......................................................................................................................... 66

    NEW_FORM ........................................................................................................................... 67

  • 8/10/2019 Form Builder Manual

    3/97

  • 8/10/2019 Form Builder Manual

    4/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 4

    Oracle 10g: Forms Builder I 2012

    How to Start Oracle Form Builder

    1. Run the database script in SQL+

    2. Start OC4J Instance (leave it on the side, dont close it) .

  • 8/10/2019 Form Builder Manual

    5/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 5

    Oracle 10g: Forms Builder I 2012

    3. Disable the proxy (step 2 & 3 are needed to run a form)

  • 8/10/2019 Form Builder Manual

    6/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 6

    Oracle 10g: Forms Builder I 2012

    4. Start the forms builder

  • 8/10/2019 Form Builder Manual

    7/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 7

    Oracle 10g: Forms Builder I 2012

    How does Forms Builder translate the form designer specification into aJava Applet ? It uses a Web server process called an Oracle9 i AS Containers for J2EE, or (OC4J)

    Instance.

    When developing, workstation runs web server and web browser in its mainmemory.

    Form Builder development environment compiles the form design file ( .fmb) to afile (.fmx) and send the complied .fmx file to the OC4J Instance, which inturntranslates the compiled .fmx file into a Java applet and then downloads the JavaApplet to your web browser.

  • 8/10/2019 Form Builder Manual

    8/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 8

    Oracle 10g: Forms Builder I 2012

    Exploring the Form Builder

    What is an Object Navigator?

    Click File, Open, select CUSTOMERDEMO (an example of a previously created & saved form)

  • 8/10/2019 Form Builder Manual

    9/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 9

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    10/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 10

    Oracle 10g: Forms Builder I 2012

    Definitions Block :

    o A block is a structure that contains a group of objects such as text fieldsor command buttons or option buttons

    Data Block :o A data block is a block that is associated with a database table. When you

    create a data block using wizard, the system automatically generates thetext items and labels for data fields in that table and provides the codefor inserting, modifying, deleting and viewing data records.

    Data block form : one or more data blocks Text items : most common block items which display text data values in text

    fields Window :

    o Rectangular area on a computer screen that has a title bar at the top.o Windows have horizontal and vertical scroll bars.o Windows can be resized, maximized and minimized.

    Canvas :o A canvas is the area in a window in which you place graphical user

    interface ( GUI) objects, such as buttons and text fields. Items : are form objects that a user sees and interacts with on the canvas. Trigger : A Trigger is a PL/SQL program that starts in response to an event. An

    event is a response to a user or system action, such as clicking a button orloading a form, that occurs in a window application.

    Relation : A relation is a form object that Forms builder creates for a form thatdisplays two data blocks whose underlying database tables have a foreign keyrelationship.

  • 8/10/2019 Form Builder Manual

    11/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 11

    Oracle 10g: Forms Builder I 2012

    Types of views 1. Ownership view :

    a. Presents the form as the top level object and then list all form object nodeson the next level. In this view, data blocks, canvases and windows all appearas objects directly below the form module.

    b. The object Navigator does not show hierarchical relationships amongwindows, canvases and blocks.

    c. It shows which items are in a specific block.

    d. It is useful for quickly accessing specific objects without having to open all ofthe higher level objects.

    2. Visual view :

    a. Presents how form objects contain other objects i.e. a form containswindow, a window contains canvases, and a canvas contains data block.

    b. Visual view does not show data block.

    c. It is useful for viewing and understanding form object relationship.

  • 8/10/2019 Form Builder Manual

    12/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 12

    Oracle 10g: Forms Builder I 2012

    How to view a Form in a Run mode?

  • 8/10/2019 Form Builder Manual

    13/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 13

    Oracle 10g: Forms Builder I 2012

    How to view information on database errors?Click Help menu, Display Error

    Dialog box displays error information

  • 8/10/2019 Form Builder Manual

    14/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 14

    Oracle 10g: Forms Builder I 2012

    Modifying FORM Properties

    Property Palette of Windows

  • 8/10/2019 Form Builder Manual

    15/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 15

    Oracle 10g: Forms Builder I 2012

    Property Palette of Frame

    Property Palette of Text Item

  • 8/10/2019 Form Builder Manual

    16/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 16

    Oracle 10g: Forms Builder I 2012

    Intersection modeWe can use property palette in intersection mode to modify one or more properties of a groupof objects so that all objects in the group have the same value or values.

    Indicates is inintersection mode

    Objects have thesame value

    Objects have thedifferent value

  • 8/10/2019 Form Builder Manual

    17/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 17

    Oracle 10g: Forms Builder I 2012

    Layout editor after changing the properties

    Change the fontproperties of all theitems

  • 8/10/2019 Form Builder Manual

    18/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 18

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    19/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 19

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    20/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 20

    Oracle 10g: Forms Builder I 2012

    Ensuring a Consistent Appearance Across Form Modules

    Why it is important to maintain a consistent look and feel? Different form developers usually work on one single database, therefore they

    may be not consistent To make the forms appear as a polished and integrated application To speed up the form development process as you dont need to do it from

    scratch To reduce user training time and frustration

    Two ways to standardize the appearance of multiple forms in anapplication:

    1. Use template forms2. Use visual attribute groups

    Template Forms It is generic form that includes standard form objects that appear in every form

    in an application, (e.g. graphics, command buttons, and program units) Ensures a uniform overall appearance for application forms You store the template form in a location that is accessible to all developers.

    In this manual , we ll create a template form for the Northwoods University database.

    Steps to create the template form1. Have a design in your mind or as sketch of how youd like the template to look

    like

    Logo

    Return

    Northwoods

    Oracle

  • 8/10/2019 Form Builder Manual

    21/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 21

    Oracle 10g: Forms Builder I 2012

    2. In the Object Navigator, select the MAIN node, and then click the Collapse All button to collapse the MAIN form objects.

    3. Select the top level Forms node, and then click the CREATE button to create anew form. Change the form module name to NORTHWOODS_TEMPLATE.

  • 8/10/2019 Form Builder Manual

    22/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 22

    Oracle 10g: Forms Builder I 2012

    4. To create the new canvas, select the Canvases node and then click the Create button. Change the canvas name to TEMPLATE_CANVAS.

    5. To configure the template window, open the Windows node, and change theform window name to TEMPLATE_WINDOW. Select the TEMPLATE_WINDOWnode, right-click, and then click PROPERTY PALETTE. Change the Title propertyvalue to Northwoods University , and then close the Property Palette.

  • 8/10/2019 Form Builder Manual

    23/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 23

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    24/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 24

    Oracle 10g: Forms Builder I 2012

    6. Save the form as NORTHWOODS_TEMPLATE.fmb in theNorthwoodsProject_Done folder.

    To create the canvas and add the template canvas objects:7. In the Object Navigator, right-click the TEMPLATE_CANVAS node, and then click

    Property Palette . Select the Background Color property, click the More button,and then select a medium gray square . Then close the Property Palette.

  • 8/10/2019 Form Builder Manual

    25/97

  • 8/10/2019 Form Builder Manual

    26/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 26

    Oracle 10g: Forms Builder I 2012

    9. To create the boilerplate Rectangle , select the rectangle tool on the tool palette,and draw a rectangle that defines the area that contains the logo and returnbutton. The rectangle should start at the top-left corner of the canvas, andshould extend the entire length of the canvas. The rectangles bottom edge

    should be even with the bottom edge of the canvas.

  • 8/10/2019 Form Builder Manual

    27/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 27

    Oracle 10g: Forms Builder I 2012

    10. Select the rectangle if necessary, select the Fill Color tool on the tool palette,and change the rectangle fill color to a lighter shade of gray than the canvasbackground color. The filled rectangle should appear slightly lighter than the restof the canvas.

  • 8/10/2019 Form Builder Manual

    28/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 28

    Oracle 10g: Forms Builder I 2012

    11. Make sure that the rectangle is still selected, select the Line Color tool on thetool palette, and then click No Line .

  • 8/10/2019 Form Builder Manual

    29/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 29

    Oracle 10g: Forms Builder I 2012

    12. To import the Northwoods University logo, click Edit on the menu bar, point toImport , and then click Image . Click Browse , navigate toNorthwoodsProject_DONE folder, select NWlogo.jpg , click Open , and then clickOk. The logo appears on the canvas. Resize and reposition the logo.

  • 8/10/2019 Form Builder Manual

    30/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 30

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    31/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 31

    Oracle 10g: Forms Builder I 2012

    13. To create the return button, select the Button tool on the tool palette, and drawthe button. Double-click the button to open its Property Palette, change thebutton properties as follows, and then close the Property Palette:

    Name RETURN_BUTTON

    Label Return

    Width 90

    Height 16

  • 8/10/2019 Form Builder Manual

    32/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 32

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    33/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 33

    Oracle 10g: Forms Builder I 2012

    14. To create the button trigger, select the button, right-click, point toSmartTriggers , and then click WHEN-BUTTON-PRESSED. Type the followingcommand, compile the trigger, debug it if necessary, and then close the PL/SQLEditor.

    EXIT_FORM;

  • 8/10/2019 Form Builder Manual

    34/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 34

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    35/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 35

    Oracle 10g: Forms Builder I 2012

    15. Click Window on the menu bar, and then click Object Navigator to open theObject Navigator. Note that when you create the Return button, Forms Builderautomatically created a new control block that contains the button. Change thenew block name to TEMPLATE_BLOCK, and then save the form.

  • 8/10/2019 Form Builder Manual

    36/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 36

    Oracle 10g: Forms Builder I 2012

    Visual Attribute Groups A form object that defines object properties (e.g. text item colors, font sizes, and

    font styles) Ensures a standard appearance & properties for block items

    You assign the visual attribute group after you create it, to Visual AttributeGroup property of form windows, canvases, and items.

    Steps to create visual attribute group for form text items1. In the Object Navigator window, select the Visual Attributes nodes under the

    NORTHWOODS_TEMPLATE form module, and then click the Create button. Anew visual attribute group object appears.

    2. Select the new visual attribute group, right-click, and then click Property Palette .

    Change the Name value to TEXT_ITEM_VISUAL_ATTRIBUTES.

  • 8/10/2019 Form Builder Manual

    37/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 37

    Oracle 10g: Forms Builder I 2012

    3. Make sure that the Visual Attribute Type property value is Common , whichmeans that the specified properties apply to all attributes in the object; whilePrompt apply only to object prompts, and Title apply only to object titles.

  • 8/10/2019 Form Builder Manual

    38/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 38

    Oracle 10g: Forms Builder I 2012

    4. To specify that the text appears in a dark blue color, select the Foreground Color property, click the More button , and then select a dark blue square .

    5. To specify that the text appears on a white background, select the BackgroundColor property, click the More button, and type (or select) white in the property.

    6. Select the Font Name property, click the More button, select Arial , and thenclick OK. Select the Font Size property, delete the current value, and then type 8.

  • 8/10/2019 Form Builder Manual

    39/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 39

    Oracle 10g: Forms Builder I 2012

    7. Close the Property Palette, save the form, and then close the form in the FormsBuilder.

  • 8/10/2019 Form Builder Manual

    40/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 40

    Oracle 10g: Forms Builder I 2012

    Creating a Form Based on a Template FormNow, you can create a new form based on the Northwoods Template

    Steps to create a new form using the template1. In the Object Navigator, click File on the menu bar, point to New , and then click

    Form Using Template . The Open dialog box opens, prompting you to select thetemplate form. Select the Northwoods_Template.fmb , and then click Open . Anew form appears in the Object Navigator. Note that the new form containsobjects in the Data Blocks, Canvases, and Visual Attributes nodes. These are theobjects that you created in the template form.

  • 8/10/2019 Form Builder Manual

    41/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 41

    Oracle 10g: Forms Builder I 2012

    2. Change the form module name to LOCATION.

  • 8/10/2019 Form Builder Manual

    42/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 42

    Oracle 10g: Forms Builder I 2012

    3. To create the new data block, select the Data Blocks node, click the Create button, make sure the Use the Data Block Wizard option button is selected, andthen click OK. When the Data Block Wizard Welcome page appears, click Next .

  • 8/10/2019 Form Builder Manual

    43/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 43

    Oracle 10g: Forms Builder I 2012

    4. When the Type page appears, make sure the Table or View option button is

    selected, and then click Next . On the Source page, click Browse , select theLOCATION database table, and click OK. Click the Move all items to target

    button to select all of the table fields for the data block, leave the Enforcedata integrity check box cleared, and then click Next .

  • 8/10/2019 Form Builder Manual

    44/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 44

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    45/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 45

    Oracle 10g: Forms Builder I 2012

    5. When the Master-Detail page appears, click Next because you do not want tocreate a master-detail relationship. Accept LOCATION for the data block name,and click Next . When the Finish page appears, make sure that the Create thedata block, then call the Layout Wizard option button is selected, and then clickFinish .

  • 8/10/2019 Form Builder Manual

    46/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 46

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    47/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 47

    Oracle 10g: Forms Builder I 2012

    6. When the Layout Wizard Welcome page appears, click Next . Accept the defaultvalues on the Canvas page, and then click Next . (Recall that you are basing thenew form on the template form, and the template forms canvas name isTEMPLATE_CANVAS.)

  • 8/10/2019 Form Builder Manual

    48/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 48

    Oracle 10g: Forms Builder I 2012

    7. On the Data Block page, click to select all of the data block fields for thelayout, and then click Next . On the item page, accept the default prompt values,and then click Next .

  • 8/10/2019 Form Builder Manual

    49/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 49

    Oracle 10g: Forms Builder I 2012

    8. On the Style page, make sure that the Form option button is selected, and thenclick Next . On the Raw page, type Location for the frame title, leave the RecordsDisplayed value as 1, click Next , and then click Finish .

  • 8/10/2019 Form Builder Manual

    50/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 50

    Oracle 10g: Forms Builder I 2012

    9. In the Layout Editor, the new data block objects are not visible because theyappear below the existing form template objects. Scroll to the bottom of thewindow, select the Location frame, and drag it to the top of the canvas. Resizethe frame, and format the text item labels, so your form looks like the figurebelow

  • 8/10/2019 Form Builder Manual

    51/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 51

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    52/97

  • 8/10/2019 Form Builder Manual

    53/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 53

    Oracle 10g: Forms Builder I 2012

    Applying The Visual Attribute Group to The Form Text Items

    Steps to apply the visual attribute group1. In the Layout Editor, select the LOC_ID text item, press and hold the Shift key,

    and then select BLDG_CODE, ROOM, and CAPACITY, so all of the text items areselected as an object group. You do not need to select the item prompts,because their properties are defined with their associated text items.

  • 8/10/2019 Form Builder Manual

    54/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 54

    Oracle 10g: Forms Builder I 2012

    2. Click Tools on the menu bar, and then click Property Palette to open theintersection Property Palette for the text item object group.

    3. Scroll down to the Visual Attributes property node, select the Visual AttributeGroup property, open the list, and select TEXT_ITEM_VISUAL_ATTRIBUTES.

  • 8/10/2019 Form Builder Manual

    55/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 55

    Oracle 10g: Forms Builder I 2012

    4. Close the Property Palette, and save the form. Note that the form text items nowappear as a dark blue text on a white background, in an 8-point Arial Regularfont, as specified in the custom visual attribute group.

    5. Run the form, click Enter Query button, and then click the Execute Query button. Step through the table records to view the records, and then close thebrowser window.

  • 8/10/2019 Form Builder Manual

    56/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 56

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    57/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 57

    Oracle 10g: Forms Builder I 2012

    6. Close the LOCATION form in Forms Builder.

  • 8/10/2019 Form Builder Manual

    58/97

  • 8/10/2019 Form Builder Manual

    59/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 59

    Oracle 10g: Forms Builder I 2012

    Opening and Closing Forms in an Integrated Database ApplicationWell create a Home Page, which serves as the entry and exit point for all other applicationforms and reports. You can write commands for the switchboard buttons and menu selectionsto call & close specific forms & reports.

    Steps to create a Home Page form using the template1. In the Object Navigator, click File on the menu bar, point to New , and then click

    Form Using Template . The Open dialog box opens, prompting you to select thetemplate form. Select the Northwoods_Template.fmb , and then click Open . Anew form appears in the Object Navigator.

  • 8/10/2019 Form Builder Manual

    60/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 60

    Oracle 10g: Forms Builder I 2012

    2. Change the form module name to HOME_PAGE.

    3. Change the Data Block name to HOME_PAGE_BLOCK, Canvas name toHOME_PAGE_CANVAS, and Window name to HOME_PAGE_WINDOW

  • 8/10/2019 Form Builder Manual

    61/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 61

    Oracle 10g: Forms Builder I 2012

    4. To edit the new form, right-click on HOME_PAGE, and then click on LayoutEditor .

    5. In the Layout Editor, click on the Text button on the tool palette, and then drawit in the middle of the form. To enter a welcome text, type Welcome toNorthwoods University Database .

  • 8/10/2019 Form Builder Manual

    62/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 62

    Oracle 10g: Forms Builder I 2012

    6. To change the format of the welcome message, change the Font to Arial , theFont Size to 16 , make it Bold , and then move it if necessary.

  • 8/10/2019 Form Builder Manual

    63/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 63

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    64/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 64

    Oracle 10g: Forms Builder I 2012

    7. Save the form as HOME_PAGE.fmb in the NorthwoodsProject_Done folder.

  • 8/10/2019 Form Builder Manual

    65/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 65

    Oracle 10g: Forms Builder I 2012

    Opening forms in an Integrated Database ApplicationForms Builder provides a number of built-in procedures that enable you to open oneform from another. The form that calls the second form is the parent form, and the formthat is called is the child form.

    Procedure Name DescriptionCALL_FORM Opens a child form and immediately switches the application focus to the

    child form.Has options for hiding the parent form, displaying the menu from theparent form, and passing a parameter list from the parent form.

    OPEN_FORM Opens a child form, with the option of not immediately changing theapplication focus to the child form.Has an option for creating a new database session for the child form orusing the parent forms database session.

    NEW_FORM Opens a child form and exit the parent form.

    CALL_FORMThis procedure opens a child form and immediately switches the application focus tothe child form.

    Uses: You can use it when the user clicks a switchboard button or selects a menu item,and expect to see the child form immediately.

    Syntax: CALL_FORM( form_specification, display, switch_menu,query_mode, parameter_list_id );

    Parameter DescriptionForm_specification Specifies the child form. Always enclosed in single quotation marks.

    Type the child form name if it is located in the default form folder, orspecify the full path and file name, including the drive letter, to the childforms .fmx file , or you can use the global path variable as following::GLOBAL .project_path || form_name.fmx

    Display Specifies whether the parent form is hidden by the child form (HIDE)default value, or not hidden (NO_HIDE) which is used if you want the twoforms to appear side by side on the screen

    Switch_menu Specifies whether the child form displays the same pull-down menus as itsparent form (NO_REPLACE) default value, or displays different menus

    (DO_REPLACE)Query_mode Specifies whether the child form runs in normal mode, in which the user

    can insert, update, or delete values (NO_QUERY_ONLY)default value, orin query mode, in which the user can only view data (QUERY_ONLY)

    Parameter_list_id Specifies the identifier for an optional parameter list that the parent formcan use to pass data values to the child form.

  • 8/10/2019 Form Builder Manual

    66/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 66

    Oracle 10g: Forms Builder I 2012

    All of the parameters are optional except for form_specification . If you decide to specify avalue for any of the optional parameters, you must specify values for all of thepreceding optional parameter in the list, without including the values for thesubsequent optional parameters if youre willing to accept the default value.

    OPEN_FORMThis procedure opens a child form and gives the developer the option of notimmediately changing the application focus to the child form.

    Uses: Many developers prefer this procedure because it allows the user to multitaskbetween parent and child forms in the application.

    Syntax: OPEN_FORM(form specification, active_mode,

    session_mode, parameter_list_id );

    Parameter DescriptionForm_specification Same as in CALL_FORM

    Active_mode Specifies whether the application focus switches to the child form(ACTIVATE) default value, or is retained by the parent form(NO_ACTIVATE)

    Session_mode Specifies whether the child form uses the same database session as theparent form (NO_SESSION) default value, or whether the child formstarts a new database session (SESSION).In the first case, the DBMS commits all uncommitted values in both formswhen a COMMIT command executes. Therefore, the benefit of the secondcase is that whenever a COMMIT command is issued, transactions arecommitted only in the form in which the commit command executes,allowing the developer to control how the form commit transactions.

    Parameter_list_id Same as in CALL_FORM

    All of the parameters are optional except for form_specification . If you decide to specify avalue for any of the optional parameters, you must specify values for all of thepreceding optional parameter in the list, without including the values for thesubsequent optional parameters if youre willing to accept the default value.

  • 8/10/2019 Form Builder Manual

    67/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 67

    Oracle 10g: Forms Builder I 2012

    NEW_FORMThis procedure opens a child form, and immediately exits the parent form.

    Uses: use it to allow users to open application forms without going through the mainform switchboard or menus. The advantage: it prevents the user from opening multiple

    forms at once, which consumes system memory. But because users should access allapplication forms from the main form, it is not recommended to this procedure.

    Syntax: NEW_FORM(form specification, rollback_mode,query_mode, parameter_list_id );

    Parameter DescriptionForm_specification Same as in CALL_FORM Rollback_mode Specifies whether the DBMS automatically commits records in the parent

    form and doesnt roll back any uncommitted transactions (NO_ROLLBACK),rolls back all uncommitted transactions/records to the last save point(TO_SAVEPOINT), or rolls back all uncommitted transactions/records andrestore the database to its state at the beginning of the database session(FULL_ROLLBACK).

    Query_mode Same as in CALL_FORMParameter_list_id Same as in CALL_FORM

  • 8/10/2019 Form Builder Manual

    68/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 68

    Oracle 10g: Forms Builder I 2012

    To create a button with a CALL_FORM procedure (you can try the other two procedures):

    1. To create a button trigger that calls the form LOCATION, select the Button toolon the tool palette, and draw the button as shown below. Double-click thebutton to open its Property Palette, change the button properties as following,and then close the Property Palette:Name GO_LOCATION_BUTTON Label Location Width 90 Height 16

  • 8/10/2019 Form Builder Manual

    69/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 69

    Oracle 10g: Forms Builder I 2012

    2. To create the button trigger, select the button, right-click, point toSmartTriggers , and then click WHEN-BUTTON-PRESSED. Type the followingcommand, compile the trigger, debug it if necessary, and then close the PL/SQLEditor ( this step is similar to step # 14 in how to create a template form ).CALL_FORM(' C:\Documents and Settings\gmazroa\MyDocuments\NorthWoodsProject_DONE\LOCATION.fmx');(The file path is specified as the form is not in the default form folder)

  • 8/10/2019 Form Builder Manual

    70/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 70

    Oracle 10g: Forms Builder I 2012

    3. Save the form, and then Run the form. When the HOME_PAGE form appears,click Location button. The Location form (LOCATION.fmx) opens.

  • 8/10/2019 Form Builder Manual

    71/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 71

    Oracle 10g: Forms Builder I 2012

    Closing forms in an Integrated Database ApplicationYou can close the form by:

    Closing the browser window Using built-in procedures through form command buttons:

    Procedure Name DescriptionCLOSE_FORM Closes the specified form, which might not be the current formEXIT_FORM Closes the current form, and provides options for committing or rolling back

    the uncommitted data

  • 8/10/2019 Form Builder Manual

    72/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 72

    Oracle 10g: Forms Builder I 2012

    CLOSE_FORMThis procedure closes a specific form, which might not be the form the user is currentlyviewing.

    Uses: it allows developers to control the open forms in an application

    Syntax: CLOSE_FORM( form_specification );

    Parameter DescriptionForm_specification The form_ID (created by the Form Builder for every open form) or the

    name of the form module as specified in the Object Navigator

    EXIT_FORM

    This procedure closes the current form.

    Uses: to create a trigger for an Exit button that the user clicks to close a form.

    Syntax: EXIT_FORM(commit_mode, rollback_mode);

    Parameter DescriptionCommit_mode Specifies how the DBMS handles umcommited form data.

    (ASK_COMMIT) default value causes the form to ask the user to saveuncommitted changes, (DO_COMMIT) automatically commits unsaveddata, (NO_COMMIT) automatically discards uncommitted changes.

    Rollback_mode Specifies if the DBMS automatically commits or rolls back uncommittedrecords in the parent form.Same as in NEW_FORM

    Both parameters are optional.

    To create a button with an EXIT_FORM procedure:

    Refer to the steps: 13 - 14 on of creating a template form (you can also try theCLOSE_FORM procedure).

    Creating Triggers to Open/Close FormsAs done previously in all buttons, a trigger is created and tested. You can create triggersin two different ways; either by right-clicking on the button, or through the ObjectNavigator (check steps# of how to create a Log-In Page form).

  • 8/10/2019 Form Builder Manual

    73/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 73

    Oracle 10g: Forms Builder I 2012

    Creating a Log-In Page

    Steps to create a Log-In Page form using the template1. In the Object Navigator, click File on the menu bar, point to New , and then click

    Form Using Template . The Open dialog box opens, prompting you to select thetemplate form. Select the Northwoods_Template.fmb , and then click Open . Anew form appears in the Object Navigator.

  • 8/10/2019 Form Builder Manual

    74/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 74

    Oracle 10g: Forms Builder I 2012

    2. Change the form module name to LOGIN_PAGE.

    3. Change the Data Block name to LOGIN _BLOCK, Canvas name to LOGIN _CANVAS, and Window name to LOGIN _WINDOW

  • 8/10/2019 Form Builder Manual

    75/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 75

    Oracle 10g: Forms Builder I 2012

    4. To edit the new form, right-click on LOGIN _PAGE, and then click on LayoutEditor .

    5. In the Layout Editor, to create a text item (that will be used by students to entertheir usernames and passwords), select the Text Item tool on the Layout Editortool palette, and then draw the text item on the form.

  • 8/10/2019 Form Builder Manual

    76/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 76

    Oracle 10g: Forms Builder I 2012

    6. To configure the text item, right-click on the text item, click on Property Pallet,then modify the following properties:Name S_IDData Type CharMaximum Length 6Prompt Student_IDVisual Attribute Group (optional)

  • 8/10/2019 Form Builder Manual

    77/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 77

    Oracle 10g: Forms Builder I 2012

    7. Then close the Property Palette.

  • 8/10/2019 Form Builder Manual

    78/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 78

    Oracle 10g: Forms Builder I 2012

    8. Repeat the previous steps to create a text item for the password with thefollowing properties:Name S_PINData Type NUMBERMaximum Length 4Prompt PasswordVisual Attribute Group (optional)

  • 8/10/2019 Form Builder Manual

    79/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 79

    Oracle 10g: Forms Builder I 2012

    9. To resize the text items, select all of the items as an object group, right-click, andthen click Property Palette . Scroll down to the Physical property node, thenchange the Width property value to 80 , and the Height property value to 14 .Close the Property Palette. The text items now all appear as the same size.

  • 8/10/2019 Form Builder Manual

    80/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 80

    Oracle 10g: Forms Builder I 2012

    10. To reposition the text items, select the first five of the text items only as anobject group, click Layout on the menu bar, and then click Align Components .

    Select theAlign Left

    option button to specify the horizontal alignment, select theStack option button to specify the vertical alignment, and then click OK.

  • 8/10/2019 Form Builder Manual

    81/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 81

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    82/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 82

    Oracle 10g: Forms Builder I 2012

    11. To create a Submit button trigger, select the Button tool on the tool palette, anddraw the button as shown below. Double-click the button to open its PropertyPalette, change the button properties as following, and then close the PropertyPalette:

    Name SUBMIT_BUTTON Label Submit Width 60 Height 16

  • 8/10/2019 Form Builder Manual

    83/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 83

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    84/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 84

    Oracle 10g: Forms Builder I 2012

    12. In the Layout Editor, select the Submit button if it is not already selected. Thenclick the Copy button on the tool bar to copy the button, and click the Pastebutton to paste the copied button onto the form. Forms Builder pastes the newbutton directly on top of the first button. Select the pasted button, and drag it

    below the original Submit button.

  • 8/10/2019 Form Builder Manual

    85/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 85

    Oracle 10g: Forms Builder I 2012

    13. Select both buttons as an object group, click Layout on the menu bar, and thenselect Align Components . Select the Align Left option button to align the buttonshorizontally, and select the Distribute option button to evenly space the buttonsvertically, and then click OK. Position the button group on the form.

  • 8/10/2019 Form Builder Manual

    86/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 86

    Oracle 10g: Forms Builder I 2012

    14. Select the second button, open its Property Palette, change its Name property toCANCEL_BUTTON and its Label property to Cancel , and then close the PropertyPalette. Then save the form.

  • 8/10/2019 Form Builder Manual

    87/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 87

    Oracle 10g: Forms Builder I 2012

    After the Student has entered his/her username and password, they need to clickSubmit button to log in. The Submit button trigger must check entered values againstthe S_ID and the S_PIN columns in the STUDENT table. If these values exist in theStudent table, the student is able to log into the system and check other forms.

  • 8/10/2019 Form Builder Manual

    88/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 88

    Oracle 10g: Forms Builder I 2012

    First, we need to create a global path variable in the PRE-FORM trigger:

    15. In the Object Navigator, open the Triggers node under the LOGIN_PAGE formmodule. Select the PRE_FORM node, right-click, and then click PL/SQL Editor .The PRE_FORM trigger opens in the PL/SQL Editor.

    16. To create the global path variable, add the following command as the firstcommand in the trigger:

    :GLOBAL.project_path := 'C:\Documents andSettings\gmazroa\My Documents\NorthWoodsProject_DONE\';

  • 8/10/2019 Form Builder Manual

    89/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 89

    Oracle 10g: Forms Builder I 2012

    To create the Submit button trigger:

    17. To create the button trigger, select the Submit button, right-click, point to

    SmartTriggers , and then click WHEN-BUTTON-PRESSED. Type the followingcommand, compile the trigger, debug it if necessary, then close the PL/SQLEditor, and save the form. ( this step is similar to step # 14 in how to create atemplate form ).

    DECLARECURSOR STUDENT_LOGIN_CURSOR IS

    SELECT S_ID, S_PINFROM STUDENT

    WHERE S_ID = :LOGIN_PAGE_BLOCK.S_ID AND S_PIN = :LOGIN_PAGE_BLOCK.S_PIN;

    STUDENT_RAW STUDENT_LOGIN_CURSOR%ROWTYPE; ATTEMPT NUMBER :=0;

    BEGIN WHILE ATTEMPT < 4 LOOP

    OPEN STUDENT_LOGIN_CURSOR;FETCH STUDENT_LOGIN_CURSOR INTO STUDENT_RAW;IF STUDENT_LOGIN_CURSOR%FOUND THEN

    MESSAGE('Log in Successfully');CALL_FORM(:GLOBAL.PROJECT_PATH ||

    'HOME_PAGE');

    ELSE MESSAGE('Wrong Username and/or Password');:LOGIN_PAGE_BLOCK.S_ID := '';:LOGIN_PAGE_BLOCK.S_PIN := '';GO_ITEM('LOGIN_PAGE_BLOCK.S_ID');

    ATTEMPT := ATTEMPT + 1;END IF;

    END LOOP;

  • 8/10/2019 Form Builder Manual

    90/97

  • 8/10/2019 Form Builder Manual

    91/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 91

    Oracle 10g: Forms Builder I 2012

    18. To test the trigger, run the form, choose a Username ( S_ID) and a Password(S_PIN) from the Student table to test, then click Submit . If you enter a correctcombination, an alert message appears, click OK, then the HOME_PAGE formopens.

  • 8/10/2019 Form Builder Manual

    92/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 92

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    93/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 93

    Oracle 10g: Forms Builder I 2012

    19. Test the form to see what happens if you enter a faulty combination and seehow an alert message appears, click OK. After exemption the three trials, theEXIT_PAGE form opens. ( The EXIT_PAGE form is created, compiled, and tested

  • 8/10/2019 Form Builder Manual

    94/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 94

    Oracle 10g: Forms Builder I 2012

    before running the LOGIN_PAGE form to create the EXIT_PAGE .fmx file . This formwas created for illustration purposes only )

  • 8/10/2019 Form Builder Manual

    95/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 95

    Oracle 10g: Forms Builder I 2012

    To create the Cancel button trigger:

    20. To create the button trigger, select the Cancel button, right-click, point toSmartTriggers , and then click WHEN-BUTTON-PRESSED. Type the followingcommand that will clear the text items, compile the trigger, debug it if necessary,

    then close the PL/SQL Editor, and save the form.:LOGIN_PAGE_BLOCK.S_ID := '';:LOGIN_PAGE_BLOCK.S_PIN := '';

    21. To test the trigger, run the form, type any combination for the username andpassword, and then click on Cancel . Notice how the fields are cleared now.

  • 8/10/2019 Form Builder Manual

    96/97

    I S 3 3 3 I n f o r m a t i o n S y s t e m s D e v e l o p m e n t Page 96

    Oracle 10g: Forms Builder I 2012

  • 8/10/2019 Form Builder Manual

    97/97

    Oracle 10g: Forms Builder I 2012

    Problem:

    When trying a fault combination of username and password three times, it doesnt go tothe EXIT_PAGE form . I tried to solve it but couldnt. I think there is a problem with theATTEMPTS variable.

    After fixing this problem, we need to:

    Add comments to the code Copy the code and paste it here Have a new print screen of the new one and paste it here Have a print screen of the EXIT_PAGE form Alternative way to create the Cancel button trigger (through Programs Unit node), if

    needed