This content has been marked as final. Show 23 replies
Is it this what you try to do?: http://apex.shellprompt.net/pls/apex/f?p=286:9
I just made that example... this is my query:
SELECT "EMPNO", <other columns of emp table>, "COMM", "DEPTNO",
HTMLDB_ITEM.SELECT_LIST_FROM_LOV_XL(2,job,'JOB_LOV_D','multiple size = "3"') S_LOV_MSIZE_3
JOB_LOV_D is an LOV which does a select of the jobs.
Hope this helps,
As you probably figured out, the multiselect list is rendered fine but when you select multiple items from it, the g_fNN arrays get confused. Instead of storing each entry g_f01(i) as a colon-delimited list of values, it creates multiple entries g_f01(1), g_f01(2) and there is no way to tell which entry belongs to which row on the tabular form.
Maybe someone from Oracle has some ideas, but I think this is not doable in APEX. Accept processing expects just 1 value per g_fNN array entry.
Run the page in debug mode, select bunch of values from each select list, click Submit button and see the debug entries written by the process
for i in 1..apex_application.g_f01.count
Hi Dimitri ,
thanks for your thoughts. The rendering part is fine, but when the page is submitted, it returns only one value, instead of multiple values selected in the LOV. I would appreciate if you could help me in getting the multiple values from this LOV.
Vikas - thanks for your input. I would appreciate if you could share any possible workarounds?
thanks for your help,
Well, the workaround is ugly.
a. render a hidden apex_item.hidden(2,...) field on the tabular form.
c. Use the hidden array apex_application.g_f02 in your accept processing, parse them on the delimiter and do whatever you need with the individual values
Like I said, not pretty!
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/
See my little example page http://apex.oracle.com/pls/otn/f?p=24317:13
1. Run it in Debug mode, put YES in the Debug position in the f?p= URL
2. Select Two, Three, Four on the first row
3. Select Three, Four on the second row
4. Select Four on the third row
You will see that the debug shows
0.07: i=1,f02(i)=TWO:THREE:FOURwhich is what you need. i.e. each entry in the f02 array contains a colon-delimited list of the multiple values you selected from the multi-select list.
The query is
APEX_ITEM.SELECT_LIST_FROM_LOV(1,null,'SOME_LOV','multiple size = "6" onclick="Multi(this)"') lov
function Multi(p_this)Hope this helps.
if (l_selected.constructor == Array) l_selected=l_selected.join(':');
p_this.parentNode.firstChild.value = l_selected;
alert(p_this.value) and it prints one value eventhough multiple values are selected.
could you please throw some light on this?
thanks for your time and help,
My example works fine in Firefox. I am really not sure why it doesn't work in IE and its stupid idiosyncracies. Maybe someone else can extend the approach to work with IE.
Google for multi select list and onclick/onchange to see if IE has any quirks in this area
Update: Googling gave me http://www.digitalamit.com/blog/blog/23.html which suggests to use a onblur event instead. I changed my example to do that and it seems to work fine in IE.
I have created a sample page. The first query region contains the "empno" and "lov value". the second region is just a report to display the updated values after submitting the first region. as an example, I'm selecting the following values in LOV for testing
7499 one and two
7521 one, two and three
after selecting the above values in the first region and submitted, I'm picking the hidden value and written into the test_table in the page process. I was expecting the following values in the table in the format below, but all the three rows single value.
username/password - email@example.com/testapp
page #4 in test application has the query region and the process
thanks for your help,
You were making a very simple mistake.
In your after-submit process, the multiple colon-delimited values are stored in the hidden array (g_f03 in your example, not g_f02).
Change the onclick event to a onblur event, that seems to work better in IE (FF is fine either way)
Hope this helps.