You can display the same LOV at more than one place in an application. This technique is useful for applications that allow end users to access the same information in more than one context. For example, you might want end users to be able to select a customer name from an LOV when they enter a new order and also when they generate a monthly billing statement.
To use an LOV in more than one place in an application, you could assign the column values from the selected record to different return items depending on application context.
You can accomplish this by using global variables or form parameters as return items in conjunction with the SHOW_LOV Built-in subprogram.
For example, you might define an LOV based on a 4-column record group that returns values into 4 global variables, named GLOBAL.one through GLOBAL.four.
When you write the trigger to display the LOV, you also assign the values of the global variable return items to the form items appropriate for the current application context:
Trigger Text:
IF Show_LOV('generic_lov') THEN
/* The end user made a selection and Oracle Forms assigned
** the selected values to the global variable return items.
** Now assign those values to the appropriate form items:
*/
:block_A.item1 := :GLOBAL.one;
:block_A.item2 := :GLOBAL.two;
:block_A.item3 := :GLOBAL.three;
:block_A.item4 := :GLOBAL.four;
END IF;