Email Us : sunilkumark11@gmail.com
Free Training > SQL PL / SQL Forms Reports Oracle Applications
< Previous Next >

 
Forms - Types of controls

 

Text Item
It is an editable item. Used to accept data from the end user.
By default every item is a text item.

Display Item
Non editable item.
Used to display information for read only purpose.

Using display Item
Calculate netpay using calculation property.

Open the form builder tool Opening an existing form (EMP_FORM.fmb ).
Go to layout editor ( tools Layout editor )
Create display item
Click on display item icon and click on canvas.

 

Right click on display item property palette
General
Name NETPAY
Data
Data type number
Calculation
Calculation mode formula
Formula  - :SAL + NVL (:COMM, 0)
Note: Block items are referred with : ( colon ) in code.
Database
Database Item No
Prompt
Prompt Net Salary

File Save.
Program Compile module Logon for compilation (Provide connection details).
Run the form
Program Run form

Click on execute query.
Move to the next record. Observe ALLEN record.
Net salary of ALLEN is 2300 (2000 + 300 )
We can keep the cursor on Empno, Ename , Sal.
We cannot keep cursor on Net salary ( as it is a display item ).

Assignment
Create display item PF
Formula:   round (:SAL * .15 )

Check box
Used to provide user with options.
Maximum two options can be provided.
Properties
Checked value,
Unchecked value,
Initial value

Example
Add a new column gender in emp table ( by using alter command ).
( SQL> alter table emp  add ( gender varchar2(1));    ).

In EMP_FORM , in the layout editor,
Create a check box ( Click on check box icon, and the click on canvas )

 

 

Right click on the check box Property palette
General
Name GENDER
Functional
Label Gender
Value when checked M
Value when unchecked F
Data
Initial value  - M
Database
Database Item Yes
Column Name Gender
Help
Hint Checked value is MALE, Unchecked value is FEMALE

File Save.
Program Compile Module
Program Run form

Click on execute query.
Move to ALLEN record
Uncheck Gender   for ALLEN record.
Save.

Query for the data in EMP table from SQL*PLUS
SQL> select * from emp;
Observe for ALLEN row, GENDER column is changed to F.

Radio Group
It is used to represent multiple choices for user.
It is collection of radio buttons.
Each radio button represents one choice.

Radio Button
Used to represent one choice in radio group.

Example
Open existing from EMP_FORM.fmb using form builder.
Go to Layout editor ( tools Layout editor  )

Change Deptno to  radio group.
Select deptno Right click property palette Item type Radio Group
( Observe , Deptno is now not displayed in Layout).
Note: Radio group is not displayed in the Layout.

Place radio button in the in Deptno radio group.

Click on radio button icon, and click on canvas,
Radio group window is displayed.
Place in which radio group?
Select deptno - Ok

Similarly, place the 2nd radio button , 3rd radio button and 4th radio button.
( Imp: All the four radio buttons should in the same group ).

Go to the object navigator  ( F3) ,

You will find four radio buttons in the radio group  deptno.

In the property palette of the deptno,
Data
Initial Value 10

Provide the following properties for the four radio buttons ( in the property palatte)

Name- RB1
Label Accounting
Radio button Value 10

 

Name - RB2
Label  -Research
Radio button value 20

Name RB3
Label Sales
Radio button value 30

Name RB4
Label Operations
Radio button value 40

File Save
Program Compile Module
Program Run form
Execute query

Observe radio button  will be highlighted basing the deptno value of the EMP table.

Frame
Used to bind controls as a unit.
Supports to design the screen as per the user requirement.
Properties
Title text
Update Layout Manually  ( Default Automatic )

List item
It is used to represent multiple choices for user.

Properties
1) List style : 3 options

  1. Poplist
  2. Tlist
  3. Combo box

2) Elements in the list
        1) List element for display purpose
        2) List item value stored in database column
3) Initial value
             One of the list values

Example

Convert job as list item.
In Layout Editor ( F2 ), select Job Property palette    Item   type -  list Item
List style Poplist ( default )
Functional

Elements in the list

List Element      

List Element Value

Clerk

CLERK

Marketing Executive

SALESMAN

Manager

MANAGER

Analyst

ANALYST

Director

PRESIDENT

 

File Save
Program Compile Module
Program Run Form
Click on execute query
Move to ALLEN record,
In the EMP table,  ALLENs job is SALESMAN.
But in the form , JOB is displayed as Marketing Executive.

Similary, try with Tlist ( List style )

Note
 Poplist and Tlist are non editable list Item.
User cannot place his own value in list item.

Combo Box
It is editable List Item ( text item + List Item ).

Example of Combo Box
In EMP_FORM.fmb
In Layout Editor ( F2 ), select Job property palette Functional List Style Combo Box

File Save
Program Compile Module
Program Run Form

Click on Execute Query
Move to JONES record
Change JOB Field to  HR
Save.

Now, check the backend  EMP  table,
JONES job is changed to HR.

Note
In Combo Box, we can place our own values also.

 


< Previous Next >