Home » Developer & Programmer » Forms » hide/unhide depending on selecting value from LOV into text item
hide/unhide depending on selecting value from LOV into text item [message #85590] Sun, 11 July 2004 16:55 Go to next message
hudo
Messages: 165
Registered: May 2004
Senior Member
Hello,

after selecting a value from a LOV into a text item, I'd would like (depending on the selected value) to hide/unhide or lets say switch "what is displayed" on a certain canvas-tab. For example on the dedicated tab is scott.emp displayed and by selecting the value "Show table dept" from the LOV (which is of course displayed on "the main page") the scott.emp should be hided and scott.dept should be displayed on the dedicated tab.

How could this be implemented ?
Re: hide/unhide depending on selecting value from LOV into text item [message #85594 is a reply to message #85590] Sun, 11 July 2004 22:11 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
You can do this dynamically by setting item-properties like visible and enabled.
This would however create a lot of 'noise', very disturbing if you see fields appearing and disappearing.
Maybe a better option is to enable/disable complete tabs ?

hth
Re: hide/unhide depending on selecting value from LOV into text item [message #85597 is a reply to message #85590] Mon, 12 July 2004 03:56 Go to previous messageGo to next message
hudo
Messages: 165
Registered: May 2004
Senior Member
@Frank: Thanks for your tip with hiding the whole Tab-Page.
But my problem is not solved.

What I'm looking is "the right trigger".
The LOV-Button has a ITEM-TRIGGER WHEN-BUTTON-PRESSED
with at least the following code:

GO_FIELD('STATUS_LIST.STATUS_SWITCH');
DO_KEY('LIST_VALUES');

But at this stage there is no value assigned to the field STATUS_LIST.STATUS_SWITCH .
Which Trigger should I use at the STATUS_LIST.STATUS_SWITCH - item
or even the LOV-Button to start the hiding/unhiding action ?

A first approach (code) would be:

----------------------------------------------
DECLARE

tp_id TAB_PAGE;
tp_name VARCHAR2(30);


BEGIN

IF (:STATUS_LIST.STATUS_SWITCH LIKE '%not%') THEN
-- no hide/unhide action
NULL;

ELSE

--- hide emp display
tp_id := FIND_TAB_PAGE('EMP_TABLE');
SET_TAB_PAGE_PROPERTY(tp_id, visible, property_false);

--- unhide dept display
tp_id := FIND_TAB_PAGE('DEPT_TABLE');
SET_TAB_PAGE_PROPERTY(tp_id, visible, property_true);

GO_BLOCK('DEPT');

--- set DEFAULT_WHERE clause for DEPT depending on
--- value of TEXT ITEM :STATUS_LIST.STATUS_IO

IF (:STATUS_LIST.STATUS_IO NOT LIKE '%not%') THEN
SET_BLOCK_PROPERTY('DEPT' ,DEFAULT_WHERE , .... );
EXECUTE_QUERY;

ELSE

SET_BLOCK_PROPERTY('DEPT' ,DEFAULT_WHERE , .... );
EXECUTE_QUERY;

END IF; ---DEFAULT_WHERE

END IF; ---switch

END;
--------------------------------------

But which Trigger should I use ??
Re: hide/unhide depending on selecting value from LOV into text item [message #85603 is a reply to message #85597] Mon, 12 July 2004 18:51 Go to previous messageGo to next message
Sunil
Messages: 132
Registered: September 1999
Senior Member
Try this...

1) first put your code to be executed in a forms procedure.
2) Remove the LOV name from item's property. (you are going to display LOV programmatically)
3) Define a KEY-LISTVAL trigger on the item. Use Show LOV built-in to display the List. If a value is choosen then call your forms procedure

/*

** Built-in: SHOW_LOV
** Example: Display a named List of Values (LOV)
*/
DECLARE
a_value_chosen BOOLEAN;
BEGIN
a_value_chosen := Show_Lov 'my_employee_status_lov');
IF a_value_chosen THEN
-- ******Call your code here*********
END IF;
END;
Re: hide/unhide depending on selecting value from LOV into text item [message #85621 is a reply to message #85597] Tue, 13 July 2004 15:17 Go to previous message
Zain
Messages: 30
Registered: October 2003
Member
The trigger you are looking for is POST-CHANGE. However, please be advised that this trigger is going to be deprecated in future Oracle releases.
Previous Topic: SCM problem :plzz help me out
Next Topic: radio button problem
Goto Forum:
  


Current Time: Wed Aug 07 23:29:06 CDT 2024