HIDE_WINDOW not giving desired results

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..
bpl4Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jinesh KamdarCommented:
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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bpl4Author Commented:
Thanks Jinesh,...I found the solution.
0
Jinesh KamdarCommented:
Glad u cud resolve it urself. So how did u fix it ?
0
bpl4Author 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.
0
Jinesh KamdarCommented:
Oh ok. Thanks for replying :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.