• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

Several windows in forms


I would like to ask, if there is a posibility to know witch window I've just activated or closed?
There is a lot of data blocks in my forms, and all of them are displayed in different window.
To see them I do go_block('My_Block') but when I want to close that opened window, I need
write something in when-window-closed trigger. I only know how to exit forms, but thi stime I
need only to hide (or close window). But if it is the mani window, I want to exit.

Another problem is about activating window, and if there is window with tree - I want to populate my tree. How to know witch window I activate or close, or could your privide me how to solve sucha problem with a lot of windows? Mabe it is better to create different forms, but not window?
could you help?


  • 3
  • 3
1 Solution
Muhammad Ahmad ImranDatabase DeveloperCommented:
I copy and paste this from help


** Built-in:  HIDE_WINDOW
** Example:   When a main window is closed, hide other
**            "subordinate" windows automatically. To
**            establish this window hierarchy we might define
**            a static record group in the form called
**            'WINDOW_HIERARCHY' with a structure of:
**               Parent_Window      Child_Window
**               -------------      -------------
**                 MAIN               DETAIL1
**                 MAIN               DETAIL2
**                 DETAIL1            DETAIL3
**                 DETAIL1            DETAIL4
**                 DETAIL2            DETAIL5
**                 DETAIL3            DETAIL6
**           We also have to make sure we navigate to some
**           item not on any of the canvases shown in the
**           windows we are closing, or else that window
**           will automatically be re-displayed by forms
**           since it has input focus.
PROCEDURE Close_Window( wn_name VARCHAR2,
           dest_item VARCHAR2 ) IS
  rg_id        RecordGroup;
  gc_parent    GroupColumn;
  gc_child     GroupColumn;
  the_Rowcount NUMBER;
  ** Local function called recursively to close children at
  ** all levels of the hierarchy.
  PROCEDURE Close_Win_With_Children( parent_win VARCHAR2 ) IS
    the_child  VARCHAR2(40);
    the_parent VARCHAR2(40);
    FOR j IN 1..the_Rowcount LOOP
      the_parent := Get_Group_Char_Cell(gc_parent,j);
      /* If we find a matching parent in the table */
      IF UPPER(the_parent) = UPPER(parent_win) THEN
    the_child := Get_Group_Char_Cell(gc_child,j);
    ** Close this child and any of its children
    Close_Win_With_Children( the_child );
      END IF;
    ** Close the Parent
    Hide_Window( parent_win );
  ** Setup
  rg_id        := Find_Group('WINDOW_HIERARCHY');
  gc_parent    := Find_Column('WINDOW_HIERARCHY.PARENT_WINDOW');
  gc_child     := Find_Column('WINDOW_HIERARCHY.CHILD_WINDOW');
  the_Rowcount := Get_Group_Row_Count(rg_id);
  /* Close all the child windows of 'wn_name' */
  Close_Win_With_Children( wn_name );
  /* Navigate to the Destination Item supplied by the caller */
  Go_Item( dest_item );
SolveAuthor Commented:

actually I found an answear to my question :)
here it is:
when I activate window, i can get a window's name from
:system.event_window. That's what I needed - current window name or id

Muhammad Ahmad ImranDatabase DeveloperCommented:
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

SolveAuthor Commented:
Muhammad Ahmad ImranDatabase DeveloperCommented:
you should close the question accepting my answer ;))
SolveAuthor Commented:
So, you think that your answear was exactly what I needes.... hm  :)

Submitted to PAQ with points refunded (125)

Community Support Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now