Saturday, July 25, 2015

Handling Multiple Windows

Handling Multiple Windows 


In the name of Allah, Most Gracious, Most Merciful      
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


     A window is just a container for all logical visual attributes that make up a Form Builder application. A single form may include several windows. You must create at least one content canvas for each window, but only one content canvas can be displayed at run-time, even though more than one content canvas can be assigned to the same window at design time.

Key Problem:
 When clicking the close ('X') ICON of the current window, another existing window is getting opened which is not desirable feature.


Key Reason:
 There is no default behavior in closing Oracle Window Forms; when a user chooses the Close Menu item or the upper right ('X') icon. The window form will not automatically close. You must define a form-level trigger "When-window-closed" with such associated built-ins or system variables.   


Key Solution:

When-Window-Closed trigger:

     
      In regard to Single Oracle Window  form, you can use the mentioned trigger  to  close a window pro-grammatically when the operator issues a window manager–specific close command. Issuing the close command is just perfect for a single window form.


 EXIT_FORM;

     In regard to multiple Windows form consider "SYSTEM.EVENT_WINDOW" system variable. It keeps the name of the last window for which a window interaction trigger fired. You can also use this system variable to perform different actions for different windows in your window interaction triggers.



You can close a window using built-ins.

HIDE_WINDOW,SET_WINDOW_PROPERTY, and EXIT_FORM 


WHEN-WINDOW-CLOSED trigger example at form-level...

      
Suppose you have more than a window (WINDOW1, WINDOW2 ...)
 You can perform closing each window by using the following system variable
" SYSTEM.EVENT_WINDOW".



IF :SYSTEM.EVENT_WINDOW='WINDOW1' THEN

  -- Do something while closing window1/canvas1 

         DO_KEY('exit_form');


ELSIF :SYSTEM.EVENT_WINDOW='WINDOW2' THEN

  -- Do something while closing window2/canvas2 

  HIDE_WINDOW('WINDOW2');

   ... etc.

END IF;



Or you can use the following built-ins in "WHEN-WINDOW-CLOSED" trigger 
  


HIDE_WINDOW('current_window_name');

SHOW_WINDOW('main_window');

GO_BLOCK('block_name');

GO_ITEM('next_window_item');


...This applies on any form window types or forms version

The following Link is:


    Learn more about:


·          Dependent Drop Down list


Hope this helps…

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.


No comments :