A window in oracle forms is a container for all visual objects that make up a Forms application. You can create two different type of windows in oracle forms. Lets have a brief comparisons between these two types of windows.
Modal Window:
modal window is a restricted window that the user must respond to before moving the input focus to another window. Modal windows:
  • Must be dismissed before control can be returned to a modeless window
  • Become active as soon as they display
  • Require a means of exit or dismissal
Modeless Window:
modeless window is an unrestricted window that the user can exit freely. Modeless windows:
  • Can display many at once
  • Are not necessarily active when displayed
  • Are the default window type

What is a Canvas?
A canvas is a surface inside a window container on which you place visual objects such as interface items and graphics. It is similar to the canvas upon which a picture is painted. To see a canvas and its contents at run time, you must display it in a window. A canvas always displays in the window to which it is assigned.
Canvas Types
Oracle Forms provides four types of canvases, all of which can be displayed in the same window at runtime. A canvas’ type defines how Oracle Forms will display it in the window to which it is assigned. When you create a canvas, you specify its type by setting the Canvas Type property.
The four canvas types are:
  • Content
  • Stacked
  • Tab
  • Toolbar
Content Canvas:
The most common canvas type is the content canvas (the default type). A content canvas is the “base” view that occupies the entire content pane of the window in which it is displayed. You must define at least one content canvas for each window you create.
When building an application, one of the first steps is to create content canvases that will be displayed in the windows of your form(s). While you can assign more than one content canvas to the same window at design time, at runtime only one content canvas is displayed at one time in the window.
Stacked Canvas:
A stacked canvas is displayed at top—or stacked on—the content canvas assigned to the current window. Stacked canvases obscure some part of the underlying content canvas, and often are shown and hidden programmatically. You can display more than one stacked canvas in a window at the same time.
Stacked canvases are displayed in a window along with the window’s content canvas(es) and any number of other stacked canvases. You can set the bevel, color, and pattern attributes of a stacked canvas to make it look different than the underlying content canvas.
Creating a stacked canvas is similar to creating a content canvas. To define a stacked canvas, you need to set certain canvas properties that apply only to stacked canvases, and create items and boilerplate text and graphics as you would for a content canvas. To convert an existing content canvas to a stacked canvas, simply change its Canvas Type property from Content to Stacked.
Tab Canvas:
A tab canvas—made up of one or more tab pages—allows you to group and display a large amount of related information on a single dynamic Oracle Forms canvas object. Like stacked canvases, tab canvases are displayed on top of a content canvas, partly obscuring it. Tab pages (that collectively comprise the tab canvas) each display a subset of the information displayed on the entire tab canvas.
A tab canvas can have many tab pages, and must have at least one. Think of tab pages as the folders in a filing system. Each individual tab page (folder) has a labelled tab that developers and end users click to access the page. At design time or runtime, you click the labelled tab to display the page at the front of the tab canvas, thereby obscuring any other page(s).
Tab pages are sub-objects of a tab canvas. Like the canvas to which it is attached, each tab page has properties; similarly, any item you place on a tab canvas has a canvas property as well as tab page properties. The ordering of tab pages in the Object Navigator determines the left-to-right (or top-to-bottom) order of the tabs at runtime.
Toolbar Canvas:
A toolbar canvas often is used to create toolbars for individual windows. You can create two types of toolbar canvases: horizontal or vertical. Horizontal toolbar canvases are displayed at the top of a window, just under its menu bar, while vertical toolbars are displayed along the far left edge of a window.
You can create toolbar canvases, both horizontal and vertical, for any window in a form. Oracle Forms displays horizontal toolbar canvases across the top of a window, and vertical toolbar canvases on the left edge of a window.
When you create a toolbar canvas, you assign it to a window by setting the canvas Window property, and then register it with the window by setting the window’s Vertical Toolbar Canvas or Horizontal Toolbar Canvas properties as appropriate. You can change the appearance of a toolbar at runtime by dynamically showing and hiding different items on the toolbar. You also can create more than one toolbar for the same window, and display them in response to navigation events and programmatic control, much like stacked canvases assigned to the same window.

This article is all about the fundamentals of sharing the objects in Oracle Forms , its benefits and the various ways to do it. It will describes the various methods for reusing objects – Property Classes, Copying and Subclassing Objects and Code, Object Groups, Object Libraries and  SmartClasses.
When you share and reuse objects and code, you increase productivity, decrease maintenance, increase modularity, and improve the performance of your applications. When you are developing applications, you should share and reuse objects and code wherever possible.
There are many advantages of sharing and reusing objects and code.
  • You can develop applications much more effectively and efficiently if you are not trying to “start over” each time you write a piece of code. By sharing and reusing frequently used objects and code, you can cut down development time and increase productivity.
  • You can decrease maintenance time by creating applications that use or call the same object or piece of code several times.
  • You can maintain standards by reusing objects and code.
To maximize reuse, the developer should apply the following guidelines in the order shown:
  • Accept default properties as much as possible
  • Use SmartClasses to describe an object
  • Use sets of visual attributes
 Now lets discuss the various methods of object sharing:
A) Property Class 
A property class is a named object that contains a list of properties and their settings. You can use property classes to increase productivity and improve network performance.

 Here are some of the uses of a property class:
  • It increases productivity by setting standard or frequently used values for common properties and associates them with several form builder objects.
  • It defines standard properties not just for one particular object but also for several at a time. This results in increased productivity, because it eliminates the time spent on setting identical properties for several objects.
  • It improves network performance by increasing the efficiency of message diffing.
 Note: Once an item is defined, the meta-data about the next item includes only those properties that differ from the previous item. This is referred to as message diffing.
Creating a Property Class
When you create a property class, you have all the properties from every Forms Builder object available. You choose the properties and their values to include in the property class. You can create a property class in two ways:
  • Using the Create button in the Object Navigator
  • Using the Create Property Class button
Steps to create a property class from the Object Navigator:
  1. Select the Property Class node.
  2. Select Create.
  3. Add the required properties and their values.
  4. Set the value for that property.
Steps to create a property class from the Property Palette
  1. Select the object in the Object Navigator.
  2. Select the properties to be copied into a property class in the Property Palette.
  3. Select the Property Class button.
  4. Locate the property class and change its name in the Object Navigator.
Inheriting from a Property Class
Once you create a property class and add properties, you can use the property class. To apply the properties from a property class to an object, use the Subclass Information property in the Property Palette.
What is an inherited property?
An inherited property is one that takes its value from the property class that you associated with the object. An inherited property is displayed with an arrow to the left of the property name.
What is a variant property?
variant property is one that has a modified value even though it is inherited from the property class associated with the object. You can override the setting of any inherited property to make that property variant. Variant properties are displayed with a red cross over an arrow.
Notes:
  • To convert an inherited property to a variant property, simply enter a new value over the inherited one.
  • To convert a variant property to an inherited property, click the Inherit icon in the Property Palette.
  • You can also use the Inherit icon to revert a changed property back to its default.
B) Copying and Subclassing Objects and Code
With subclassing you can make an exact copy, and then alter the properties of some objects if desired. If you change the parent class, the changes also apply to the properties of the subclassed object that you have not altered. However, any properties that you override remain overridden. This provides a powerful object inheritance model.
When you subclass a data block, you can:
  • Change the structure of the parent, automatically propagating the changes to the child
  • Add or change properties to the child to override the inheritance
You can copy or subclass objects:
  • Between modules, by dragging objects between the modules in the Object Navigator
  • Within a single module by selecting the object in the Object Navigator, pressing [Ctrl], and dragging it to create the new object
When you drag objects, a dialog box appears that asks whether you want to copy or subclass the object.
Copy or Subclass?
When you copy an object, a separate, unique version of that object is created in the target module. Any objects owned by the copied object also get copied. Changes made to a copied object in the source module do not affect the copied object in the target module.
With subclassing, you can make an exact copy, and then alter the properties of some objects. If you change the parent class, the changes also apply to the properties of the subclassed object that you have not altered.
When you subclass a data block you cannot:
  • Delete items from the child
  • Change the order of items in the child
  • Add items to the child unless you add them to the end
C) Object Groups
An object group is a logical container for a set of Forms Builder objects.
You need to define an object group when you want to package related objects for copying or subclassing in another module or if you want to bundle numerous objects into higher-level building blocks that you can use again in another application. You can package the various objects in an object group and copy the entire bundle in one operation.
Steps to create an object group
  1. Select the Object Group node in the Object Navigator.
  2. Select the Create icon.
  3. Rename the new object group that is displayed.
  4. Click the form module and expand all the nodes.
  5. Select all the objects of one type that you want to include in the object group.
  6. Drag the selected objects into the new object group entry.
Key notes about object groups
  • Including a block in an object group also includes its items, the item-level triggers, the block-level triggers and the relations. You cannot use any of these objects in an object group without the block.
  • It is not possible to include another object group.
  • Deleting an object from a module automatically deletes the object from the object group.
  • Deleting an object group from a module does not delete the objects it contains from the module.
D) Object Libraries
Object libraries are convenient containers of objects for reuse. They simplify reuse in complex environments, and they support corporate, project, and personal standards. An object library can contain simple objects, property classes, object groups, and program units, but they are protected against change in the library. Objects can be used as standards (classes) for other objects.
Why object libraries instead of object groups?
  • Object libraries are external to the form, so are easily shared among form modules.
  • Object libraries can contain individual items; for example, iconic buttons. The smallest unit accepted in an object group is a block.
  • Object libraries accept PL/SQL program units.
  • If you change an object in an object library, all forms that contain the subclassed object reflect the change.
Object libraries appear in the Navigator if they are open. You can create, open, and close object libraries like other modules. Forms Builder automatically opens all object libraries that were open when you last closed Forms Builder.
Note: You cannot modify objects inside the object library itself. To make changes, drag the object into a form, change it, and drag it back to the object library.
Steps to populate an Object Library
  1. Select Tools > Object Library to display the object library.
  2. Drag objects from the Object Navigator into the object library.
  3. You can edit the descriptive comment by clicking the Edit icon in the object library interface.
E) SmartClass
A SmartClass is a special member of an Object Library. It can be used to easily subclass existing objects in a form using the SmartClass option from the right mouse button popup menu.
To use Object Library members which are not SmartClasses, you have to use the Subclass Information dialog available in the Property Palette of the form object that you are modifying.
If you frequently use certain objects as standards, such as standard buttons, date items, and alerts, you can mark them as SmartClasses by selecting each object in the object library and choosing Edit > SmartClass. You can mark many different objects, spread across multiple object libraries, as SmartClasses.
To apply a SmartClass to a Forms object, perform the following steps:
1. Right-click an object in the Layout Editor or Navigator.
2. From the pop-up menu, select SmartClasses. The SmartClasses pop-up menu lists all the SmartClasses from all open object libraries that have the same type as the object, and, for items, also have the same item type; for example, push button, text item.
3. Select a class for the object; it then becomes the parent class of the object. You can see its details in the Subclass Information dialog box in the object’s Property Palette, just like any other subclassed object.

In this article we will discuss how a Oracle Form runs in a server and how the client machines access them.
Oracle Forms applications are deployed to the web through a three-tier architecture. Application logic and the Forms Services Runtime Engine reside on the middle-tier application server. All trigger processing occurs on database and application servers, while user interface processing occurs on the Forms client. End users can run Forms Developer applications in a Web browser.
Before discussing the runtime process, lets go through the Forms Services Architecture in brief. Forms Services consists of four major components: the Forms Servlet, the Java client (Forms Client), the Forms Listener Servlet, and the Forms Runtime Engine.

Forms Services Architecture
The Forms Servlet is a Java servlet(class) that is capable of creating a dynamic HTML file in the client browser.
The Java client or Forms client(applet) is nothing but a set of Java classes that are downloaded to the client machine when any Form application is called in the client machine for the first time. This component is only responsible to display the Form in the Browser and send the user interactions to the middle tier. You do not have to deploy a separate Java applet for each application. The same generic applet is used to run any Forms Services application, regardless of its size and complexity.

The Forms Listener Servlet is a Java servlet that runs in a Web server equipped with a servlet engine, such as OC4J. The Forms Listener Servlet is in charge of managing the creation of the Forms Runtime process for each client and managing the network communications that occur between the client and its associated Forms Runtime process, through the Web server.
The Forms Runtime Engine is a process on the Application Server that is started by the Forms Listener Servlet. The Forms Runtime Engine handles all the application logic and Forms functionality and executes the code written into the application.
Users request a Form application in their Web browsers by entering a URL that points to the application. Forms Services then generates an HTML file that downloads a Java applet to the client machine. This small applet is capable of displaying the user interface of any form, while the application logic is executed on the middle tier.
The URL to invoke an application must have the following format:
http://host[:port]/forms servlet or html file[parameters] (optional portions of URL enclosed in brackets)
For Example:http://dummysite.com:8888/forms90/f90servlet
Where http is a protocol, dummysite.com is the host, 8888 is the port number and forms90/f90servlet is forms servlet alias.
We should have a Java Runtime Environment(JRE) in the client machine to run our Forms. We can use JInitiator, a plug-in that provides a JRE capable of running the Forms applet.
The below is the complete process how we can access a Form application through web:

Oracle Forms Runtime
1] The user accesses the Forms application through a URL in the web browser.
http://dummysite.com:8888/forms90/f90servlet
2] In the middle tier, Oracle HTTP Server or OC4J receives an HTTP request from the browser client and contacts the Forms Servlet.
3] The Forms Servlet dynamically creates an HTML page in the client machine containing all the information to start the Forms session.

Oracle Forms Runtime
4] The Oracle HTTP Server or OC4J downloads a generic applet to the client machine if the Form is called for the first time. The client machine caches the applet so that it can run future Forms applications without downloading it again.
5] The applet in the client machine contacts the Forms Listener Servlet in the middle tier to start the session. The Forms Listener Servlet starts an instance of the Forms Runtime Engine on the Forms Server (middle tier).
6] The Forms Listener Servlet establishes a connection with the Runtime Engine, which connects to the database if needed and loads application executable files.

Oracle Forms Runtime
7] The Forms applet displays the Form in the main window of the user’s Web browser.
8] The Forms Listener Servlet, working through OC4J or the HTTP Server, manages communication between the Forms applet and the Runtime Engine.

Form Name: Customers.fmb
Deployed Application: Custom AR Application
Responsibility: US Receivables Super User
Step 1: COPYING FILES FROM THE SERVER
a) Copy TEMPLATE.fmb file from $AU_TOP/forms/US folder to a local directory. Also downloadAPPSTAND.fmb file and place it in D:DevSuiteHome_1forms
b) Copy All PL/SQL Libraries from $AU_TOP/resource/US folder (one time only). Download all the .pll and .plx files to D:DevSuiteHome_1forms
Step 2: DESIGN THE FROM IN ORACLE FORMS BUILDER
a) Remove the Defaults
                        >Open Oracle Forms Builder
                        >Open the form TEMPLATE.fmb
                        >Rename the form (ex XXARCUST_1)
                        >Delete the followings from object nevigator.
                                    >Go to Data Blocks and delete BLOCKNAME, DETAILBLOCK
                                    >Go to Windows and delete BLOCKNAME
                                    >Go to Canvases and delete BLOCKNAME
b) Create a new Window (ex WINDOW10)
c) Create a new Canvas (ex CANVAS10) and attached it to the new Window via Property Palate
d) Create a new Datablock (ex CUSTOMERS) wth items  from a table.
e) Create a frame in the Canvas and attached the items
f) Modify the PRE-FORM Trigger
                        >Go to triggers—PREFORM
                        >Original Code:                    
FND_STANDARD.FORM_INFO(‘$Revision: 120.0 $’, ‘Template Form’, ‘FND’,
‘$Date: 2005/05/06 23:25  $’, ‘$Author: appldev $’);
 app_standard.event(‘PRE-FORM’);
 app_window.set_window_position(‘BLOCKNAME’, ‘FIRST_WINDOW’);
                     
                        >Modified Code:                     
  FND_STANDARD.FORM_INFO(‘$Revision: 1.0 $’, ‘XXARCUST_1’,’CUST_FORM’,
  ’$Date: 2010/01/06 16:25  $’, ‘$Author: Dibyajyoti $’);
   app_standard.event(‘PRE-FORM’);
    app_window.set_window_position(‘WINDOW10′, ‘FIRST_WINDOW’);
                     
                        > Compile the code

g) Modification for Program unit
                        > Go to APP_CUSTOM*(Package Body)
                        >Type your First window name in place of <your first window>
                        > Compile the code
h) If any Item in the Datablock is of Date type and you want to attach a standard calender to it
    (ex Orderdate item of Customers datablock), do the following
                        > Go to Orderdate > Property palate > Subclass Information > Property Class
                        > Give property class name as TEXT_ITEM_DATE
                        > Attach LOV as ENABLE_LIST_LAMP
                        > Create KEY-LISTVAL item level trigger & add following code into it
                           calendar.show; and compile the trigger.
Step 3: DEPLOY THE FORM IN THE SERVER
                         > Upload your .fmb file
Step 4: CREATE THE .fmx FILE IN THE SERVER
>Type the code
$ORACLE_HOME/bin/frmcmp_batch module=$XXAR_TOP/forms/US/CUSTOMERS.fmb         userid=<username>/<password>  output_file=$XXAR_TOP/forms/US/ CUSTOMERS.fmx module_type=form  compile_all=special
Step 5: REGISTARING THE FORM IN ORACLE APPS
a) Registaring the FORM in Oracle Apps
                        > Go to Application Developer  —> Application —> Form
                        > Give the details:
                     
                         FORM: CUSTOMERS(name of the custom form)
                         APPLICATION: Custom AR Application
                         User Form Name: CUSTOMERS_DETAIL
                         Description: Customer Detail form
                        > save
b) Registaring the FORM to a form function
                        > System Administrator —->Application —-> Function
                        > Give the details:
                         Form—->form:CUSTOMERS_DETAIL
                         Function:XX_CUSTOMER_DETAIL
                         APPLICATION: Custom AR Application
                         Properties —> Type: Form
                         User Function Name: CUSTOMERS_DETAIL_FUNCTION
                        > save
c) Finding the menu to which the above form function is to be attached. Again the menu is attached to a responsibilty. So we have go in the reverse order to find the menu name.
                        > System Administrator —->Security —-> Responsibility —->Define
                        > Press F11
                        > Responsibility Name: %US%Rec (searching for US Receivables Super User)
                        > Press Ctrl + F11
                        > This things will come in the form
                         Responsibility Name: US Receivables Super User
                          Application:Receivables (will come automatically )
                        >Take the Menu name   —>AR_NAVIGATE_GUI
                     
d) Attaching the function to a Submenu of the above Main menu
                        > System Administrator —->Application —> Menu
                        > Press F11
                        > Menu: AR_NAVIGATE_GUI
                        > Press Ctrl+F11
                        > Promt: Custom Interfaces
                        > Submenu: XXAR_CUSTOM
                       
                        >System Administrator —->Application —> Menu
                        > Press F11
                        > Menu: XXAR_CUSTOM
                        > Press Ctrl+F11
                        > Create a new
                        > Promt: Customer Detail Form (It will display in the nevigator)
                        >Function: CUSTOMERS_DETAIL_FUNCTION (Attach the function to the submenu)
                        > save
                        >One request has been submitted to recompile your menus in the database
e) Viewing the request submitted in the background to recompile the menus to attach the function
                        > Go to View——–>Requests———>Find
                        >The status should be :Compiled  Normal
Step 6: VIEWING THE FORM IN ORACLE APPLICATION:
                        >Go to Oracle apps front end.
                        >Login with username and password
                        >Go to US Receivables Super User—>Custom Interfaces —>Customer Detail Form