KEMBAR78
Oracle Forms: Introduction to multiple Forms | PPT
Introduction to Multiple Form Applications
http://ebiztechnics.blogspot.com
Objectives
• Call one form from another from module
• Define Multiple form functionality
http://ebiztechnics.blogspot.com
Multiple Form Applications
• Behavior:
– Flexible navigation between windows
– Single or multiple database connections
– Transactions may span forms, if required
– Commits in order of opening forms, starting with current form
• Links:
– Data is exchanged by global variables or parameter lists
– Code is shared as required, through libraries and the database
http://ebiztechnics.blogspot.com
Multiple Form Sessions
Form A
Forms
Runtime
Global variables
Form B
Open
Form C
Open
Form D
Open
http://ebiztechnics.blogspot.com
OPEN_FORM Built-in
MDI
FORM A
MDI
FORM A
Modeless
FORM B
OPEN_FORM
http://ebiztechnics.blogspot.com
Implementing Multiple Forms
1. Define windows and positions for each form.
2. Plan global variables and their names.
3. Implement triggers to:
• Open other forms
• Initialize global variables from calling forms
• Use global variables in opened forms
http://ebiztechnics.blogspot.com
Linking by Global Variables
Employees
Departments
GLOBAL.dept_id
Deptno
http://ebiztechnics.blogspot.com
Opening Another Forms
:GLOBAL.dept_id:=:DEPT.deptno;
OPEN_FORM(‘employees’);
• Control passes immediately to the Employees form—no statements
after OPEN_FORM are processed.
• If the Activate_Mode argument is set to NO_ACTIVATE, you retain
control in the current form.
• The transaction continues unless it was explicitly committed before.
http://ebiztechnics.blogspot.com
Restricted Query at Startup
Execute_Query;
:EMP.deptno := :GLOBAL.dept_id;
When-New-Form-Instance - Form Level
Pre-Query - Block Level
http://ebiztechnics.blogspot.com
Global Variables in Opened Form
• Assign Global variables values in opened form with
DEFAULT_VALUE Built-in.
• DEFAULT_VALUE ensures the existence of global variables.
• You can use global variables to communicate that the form is running.
• Pre-Form Example:
DEFAULT_VALUE(‘ ‘,‘GLOBAL.dept_id’);
http://ebiztechnics.blogspot.com
Conditional Opening
:GLOBAL.dept_id := :DEPT.deptno;
IF ID_NULL(FIND_FORM(’EMPLOYEES’)) THEN
OPEN_FORM(’EMPLOYEES’);
ELSE
GO_FORM(’EMPLOYEES’);
END IF;
http://ebiztechnics.blogspot.com
Closing a Form with EXIT_FORM
• The default functionality is the same as for the Exit key.
• The Commit_Mode argument defines action on uncommitted changes.
ENTER;
IF :SYSTEM.FORM_STATUS = ’CHANGED’ THEN
EXIT_FORM( DO_COMMIT );
ELSE
EXIT_FORM( NO_COMMIT );
END IF;
http://ebiztechnics.blogspot.com
Summary
• The OPEN_FORM built-in provides multiple concurrent
forms in a session.
• Forms communicate through global variables:
– Load key values in the parent form
– Use global values in opened forms for
When-New-Form-Instance and Pre-Query
http://ebiztechnics.blogspot.com

Oracle Forms: Introduction to multiple Forms

  • 1.
    Introduction to MultipleForm Applications http://ebiztechnics.blogspot.com
  • 2.
    Objectives • Call oneform from another from module • Define Multiple form functionality http://ebiztechnics.blogspot.com
  • 3.
    Multiple Form Applications •Behavior: – Flexible navigation between windows – Single or multiple database connections – Transactions may span forms, if required – Commits in order of opening forms, starting with current form • Links: – Data is exchanged by global variables or parameter lists – Code is shared as required, through libraries and the database http://ebiztechnics.blogspot.com
  • 4.
    Multiple Form Sessions FormA Forms Runtime Global variables Form B Open Form C Open Form D Open http://ebiztechnics.blogspot.com
  • 5.
    OPEN_FORM Built-in MDI FORM A MDI FORMA Modeless FORM B OPEN_FORM http://ebiztechnics.blogspot.com
  • 6.
    Implementing Multiple Forms 1.Define windows and positions for each form. 2. Plan global variables and their names. 3. Implement triggers to: • Open other forms • Initialize global variables from calling forms • Use global variables in opened forms http://ebiztechnics.blogspot.com
  • 7.
    Linking by GlobalVariables Employees Departments GLOBAL.dept_id Deptno http://ebiztechnics.blogspot.com
  • 8.
    Opening Another Forms :GLOBAL.dept_id:=:DEPT.deptno; OPEN_FORM(‘employees’); •Control passes immediately to the Employees form—no statements after OPEN_FORM are processed. • If the Activate_Mode argument is set to NO_ACTIVATE, you retain control in the current form. • The transaction continues unless it was explicitly committed before. http://ebiztechnics.blogspot.com
  • 9.
    Restricted Query atStartup Execute_Query; :EMP.deptno := :GLOBAL.dept_id; When-New-Form-Instance - Form Level Pre-Query - Block Level http://ebiztechnics.blogspot.com
  • 10.
    Global Variables inOpened Form • Assign Global variables values in opened form with DEFAULT_VALUE Built-in. • DEFAULT_VALUE ensures the existence of global variables. • You can use global variables to communicate that the form is running. • Pre-Form Example: DEFAULT_VALUE(‘ ‘,‘GLOBAL.dept_id’); http://ebiztechnics.blogspot.com
  • 11.
    Conditional Opening :GLOBAL.dept_id :=:DEPT.deptno; IF ID_NULL(FIND_FORM(’EMPLOYEES’)) THEN OPEN_FORM(’EMPLOYEES’); ELSE GO_FORM(’EMPLOYEES’); END IF; http://ebiztechnics.blogspot.com
  • 12.
    Closing a Formwith EXIT_FORM • The default functionality is the same as for the Exit key. • The Commit_Mode argument defines action on uncommitted changes. ENTER; IF :SYSTEM.FORM_STATUS = ’CHANGED’ THEN EXIT_FORM( DO_COMMIT ); ELSE EXIT_FORM( NO_COMMIT ); END IF; http://ebiztechnics.blogspot.com
  • 13.
    Summary • The OPEN_FORMbuilt-in provides multiple concurrent forms in a session. • Forms communicate through global variables: – Load key values in the parent form – Use global values in opened forms for When-New-Form-Instance and Pre-Query http://ebiztechnics.blogspot.com

Editor's Notes

  • #8 Note: It is possible to start up several instances of the same form,using OPEN_FORM, unless The application does appropriate tests before calling this built-in. For example, test a Flag (global variable) set by an opened form at startup, which the opened form could Reset on exit, or use the FIND_FORM built-in.