Select multiple value in LOV [message #306823] |
Mon, 17 March 2008 00:35 |
benseer
Messages: 22 Registered: October 2005 Location: Bangalore
|
Junior Member |
|
|
Hi,
How can I select mulitple values in a LOV
For Eg: I have a dropdown LOV with department names from table Dept,
I want to select values "Reserach" & "Sales" and those values to be returned. How can I achieve this ?
|
|
|
Re: Select multiple value in LOV [message #306921 is a reply to message #306823] |
Mon, 17 March 2008 05:06 |
dr.s.raghunathan
Messages: 540 Registered: February 2008
|
Senior Member |
|
|
hi
multiple column value can be concatenated using pipe and can
be returned as single return value and can be stored in page item. subsequently using substr or instr you shall break the data
and store it in different page items.
|
|
|
|
|
Re: Select multiple value in LOV [message #307018 is a reply to message #306823] |
Mon, 17 March 2008 09:49 |
rajy_salim
Messages: 204 Registered: January 2008 Location: Beirut - Lebanon
|
Senior Member |
|
|
You can use a shuttle to select multiple values. The left side of the shuttle is filled with an LOV. The return value of this shuttle is a colon delimited string. Using SUBSTR and INSTR you can retrieve values . . .
|
|
|
|
Re: Select multiple value in LOV [message #352399 is a reply to message #306823] |
Tue, 07 October 2008 08:12 |
c_stenersen
Messages: 255 Registered: August 2007
|
Senior Member |
|
|
You can use a multiselect list for this. The item will then return the values separated by colons.
If you have the item P1_X and want to set it to the values "Research" and "Sales" so that they are selected when entering the page, you can simply have a computation with a static assignment setting the value to Research:Sales.
When fetching the values chosen, you don't have to use instr. ApEx has a function for splitting this into an array so that you can loop trough the chosen values.
APEX_UTIL.STRING_TO_TABLE (
p_string IN VARCHAR2,
p_separator IN VARCHAR2 DEFAULT ':')
RETURN APEX_APPLICATION_GLOBAL.VC_ARR2;
So for the item P1_X you could write:
declare
v_p1_x_arr apex_application_global.vc_arr2;
begin
v_p1_x_arr := apex_util.string_to_table(:P1_X);
for i in 1..v_p1_x_arr.count loop
--Do something using v_p1_x_arr(i)
end loop;
end;
|
|
|