We help IT Professionals succeed at work.

HIDE_WINDOW not giving desired results

bpl4
bpl4 asked
on
I have a button on my first window and in the WHEN-BUTTON-PRESSED of this I have this code:
HIDE_WINDOW('win1');
SHOW_WINDOW('win2');

Although the second window opens its hidden behind the first.I have to minimize it to go to the second.Why it is not hiding...please advise.
Thanks..
Comment
Watch Question

Here's a ref. from an ebook. See if this helps.
HIDE_WINDOW built-in
--------------------
Hides the given window. HIDE_WINDOW is equivalent to setting VISIBLE to No by calling SET_WINDOW_PROPERTY.
Syntax:
PROCEDURE HIDE_WINDOW (window_id Window);
PROCEDURE HIDE_WINDOW (window_name VARCHAR2);
 
Built-in Type: unrestricted procedure
Enter Query Mode: yes
 
Parameters:
 
window_id - Specifies the unique ID that Form Builder assigns the window at the time it creates it. Use the FIND_WINDOW built-in to return the ID to an appropriately typed variable. The data type of the ID is Window.
 
window_name - Specifies the name that you gave the window when creating it.
 
HIDE_WINDOW examples
 
/*
** 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);
BEGIN
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;
END LOOP;
/*
** Close the Parent
*/
Hide_Window( parent_win );
END;
BEGIN
/*
** 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 );
END;

Open in new window

Author

Commented:
Thanks Jinesh,...I found the solution.
Glad u cud resolve it urself. So how did u fix it ?

Author

Commented:
I mean I got the hint from the excerpt u pasted here...I added a go_item to item on the content canvas of the window I wanted to open...and then it all worked...
Thanks.
Oh ok. Thanks for replying :)