Hide And Unhide Oracle Forms 6i Button
There are times when application buttons of Oracle Form Applications should be hidden from the user when certain criteria are met.
For example, changing of student status can only be done when students have not yet graduated or completed. A button called CHANGE STATUS should disappear from the Oracle Forms when student status is graduated and completed. This could be done by having a procedure to hide the item.
/* For Hiding a Block Item */
-- Tony
-- 24 July 2008
PROCEDURE HIDE_ITEM( item_name VARCHAR2, hide_it BOOLEAN) IS
it_id Item;
BEGIN
it_id := Find_Item(item_name);
IF Id_Null(it_id) THEN
Message('No such item: '||item_name);
RAISE Form_Trigger_Failure;
ELSE
IF hide_it THEN
Set_Item_Property(it_id,VISIBLE,PROPERTY_FALSE);
ELSE
Set_Item_Property(it_id,VISIBLE,PROPERTY_TRUE);
Set_Item_Property(it_id,ENABLED,PROPERTY_TRUE);
Set_Item_Property(it_id,NAVIGABLE,PROPERTY_TRUE);
END IF;
END IF;
END;
The procedure should be created in the form module’s (ex. STUDENT) Program Units. Then it could then be used during post-query trigger of a form block to control hiding and showing of the button.





Posted
on
Thursday, July 24th, 2008 at 7:14 am under

Dear Sir,
This code have very help full for me.
thanks
August 14th, 2008 at 1:40 pm[…] HIDE_ITEM which accepts two parameters the object to be hidden and the state of the object. See HIDE_ITEM procedure from http://www.techxplore.net/2008/07/24/hide-and-unhide-oracle-forms-6i-button/ for the full […]
November 14th, 2008 at 12:13 amHi,
I have a related question. What if I need to hide an item between two items? how will the canvas adjust the layout? see sample below
column1 | column2 | column3
red white blue
what if I need to hide column 2? how will i put a logic to adjust column3 at run time?
December 18th, 2008 at 1:10 am