Introduction To Form Builder - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Introduction To Form Builder

Description:

PL/SQL procedure that runs in response to a user or system action ... when Unchecked. 39. Eyad ... Value when Unchecked: data value of the item when the ... – PowerPoint PPT presentation

Number of Views:290
Avg rating:3.0/5.0
Slides: 42
Provided by: julie48
Category:

less

Transcript and Presenter's Notes

Title: Introduction To Form Builder


1
Introduction To Form Builder
  • Part C

2
Objectives
  • Use Sequence to generate value in a form
  • Create List Of Value (LOVs)
  • Form items

3
Form Triggers
  • PL/SQL procedure that runs in response to a user
    or system action
  • Clicking a button
  • Loading a form
  • Exiting a form
  • Triggers can be associated with
  • An entire form (form level)
  • A block (block level)
  • A specific form item (item level)

4
Using Sequences to Generate Primary Key Values
  • Form can be set up to automatically retrieve next
    sequence number and populate primary key field
  • Form triggers respond to user events or system
    actions
  • To create a trigger, specify
  • Triggers object (i.e. specific button)
  • Trigger event (i.e. button press)
  • Code that executes
  • Use PRE-FORM event to perform action when form
    loads
  • Use Triggers dialog box to create triggers for
    objects

5
PL/SQL Editor
6
Syntax Error in PL/SQL Editor
7
Creating Form Triggers (continued)
  • Triggers dialog box
  • Shows all block events that can have associated
    triggers
  • Search using wildcards
  • PL/SQL Editor
  • Environment for writing, compiling, and editing
    PL/SQL programs
  • Source code pane
  • Status line

8
Triggers Dialog Box
9
Using Form Triggers
  • Creating a trigger
  • select the form or form item event
  • type the trigger code
  • Referencing a form item in PL/SQL code
  • block_name.item_name
  • Triggers are compiled before a form is run

10
Using Sequences in Forms
  • Create a block-level WHEN-CREATE-RECORD trigger
  • Trigger PL/SQL code
  • SELECT sequence_name.NEXTVAL
  • INTO block_name.item_name
  • FROM DUAL

11
LOV
12
Form Lists of Values (LOVs)
  • List of legal values that can be selected for use
    in a form field

LOV command button
LOV display
13
Creating a List of Values (LOV)
  • Use a list of values (LOV) to eliminate user
    errors
  • Pop-up list allows user to select value from list
    of choices rather than typing
  • User can open LOV by
  • Typing Ctrl-L with cursor in LOV text field
  • Click Edit then Display List from Forms Services
    menu
  • Clicking command button with attached trigger to
    open LOV
  • LOV allows user to search for values using
    wildcards
  • LOV data values come from a record group

14
LOV Display
15
Creating an LOV
  • To create LOV
  • Use LOV Wizard
  • Manually create using Object Navigator
  • LOV can contain one or more columns
  • LOV appearance can be customized using layout
    wizard
  • Create a button on main form to launch LOV using
    button tool, attach form trigger to button that
    opens LOV

16
Creating an LOV Using the LOV Wizard
  • Use the LOV Wizard to
  • Specify the LOV display records using a SQL query
  • Format the LOV display
  • Attach the LOV to a form text item
  • Change the LOV and record group name in the
    Object Navigator

17
Opening the LOV Display
  • Place the insertion point in the text item to
    which the LOV is attached
  • Press CTRLL, or from Edit menu of the form
    choose the option Display List

18
LOV Command Button Trigger
  • Create a trigger for the button that does the
    following
  • Places the form insertion point in the text item
    to which the LOV is attached
  • GO_ITEM(IN_VID)
  • Executes the LIST_VALUES command
  • LIST_VALUES

19
Create an LOV
  • Right-click anywhere in module REGISTRATION and
    select LOV wizard
  • Select record group based on a query

20
Create an LOV
  • Type in a query that would retrieve all records
    from table course (do not put a semi-column at
    the end)
  • Here you will may be asked to log into the DB

21
Create an LOV
  • Select all the columns that you want to appear in
    you LOV

22
Create an LOV
  • Specify the return value for COURSENAME field
  • Return value is a field where the course name
    from your LOV will be inserted

23
Create an LOV
  • Specify title and dimensions
  • Specify the number of rows displayed at once

24
Create an LOV
  • Select COURSENAME as assigned value
  • Complete your LOV

25
Create an LOV
  • To test your LOV
  • Run the form
  • Click on CourseName field
  • Press CTRLL

26
Create an LOV control button
  • Close your form in the browser
  • Return to the Form buikder, Layout editor
  • Click on the Control Button item in the toolbar
    on the left and drag it to a desired location on
    your canvas
  • Name your button using Property palette

27
Create an LOV control button
  • Right click on the button, and open PL/SQL editor
  • Select Type TRIGGER, Name WHEN_MOUSE_CLICKED
  • Type in code the code below

28
Alternate Form Input Items
  • Radio buttons
  • Check boxes

29
Radio Buttons
  • Limits user to one of two or more related,
    mutually exclusive choices

30
Radio Groups
  • Related radio buttons are part of a radio group

Radio group
Individual related radio buttons
31
Creating Radio Buttons
  • Radio buttons
  • Represent data fields whose values must be one of
    small set of mutually exclusive selections
  • Exist within radio group
  • Select item type in Layout Wizard
  • Manually create radio buttons
  • Use Radio Button tool
  • Change properties using Property Palette
  • Align edges using Align Objects dialog box

32
Creating a Radio Group
  • Create the form using the Data Block and Layout
    Wizards
  • Open the item Property Palette, and change the
    Item Type value to Radio Group
  • Draw and format the radio buttons on the canvas
  • Modify the radio button properties
  • Modify the radio group properties

33
Important Radio Button Properties
Name how the button is referenced within the
form
Label description that appears next to the
button on the canvas
Radio Button Value associated data value in the
database
34
Important Radio Group Properties
Name how the radio group is referenced within
the form
Initial Value data value of the radio button
within the radio group that is selected when the
form first appears
35
Check Boxes
  • Used to represent fields that can have one of two
    values
  • Check box caption is interpreted as TRUE or FALSE
  • If checked, caption is true
  • If cleared, caption is false

36
Check Box Example
37
Creating a Check Box
  • Create the form using the Data Block and Layout
    Wizards
  • Open the item Property Palette, and change the
    Item Type value to Check Box
  • Modify the item properties

38
Creating Check Boxes
  • Check boxes
  • Represent data values that can have only one of
    two opposing values
  • Label represents one value
  • Value when Checked
  • Value that will be saved in database if checkbox
    checked
  • Value when Unchecked

39
Important Check Box Properties
Label description that appears next to the
check box on the canvas
Value when Checked data value of the item when
the box is checked
Value when Unchecked data value of the item
when the box is checked
Check Box Mapping of Other Values check box
status when form first opens, or when new blank
record is added
40
Convert Major into List Item
  • In the Property palette, change item type to
    list item

41
Converting Major into a list item
  • Add item values using the property palette
Write a Comment
User Comments (0)
About PowerShow.com