Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

set selected values on multi select list in tabular form

melinda_fApr 18 2016 — edited May 6 2016

Hello,

Running APEX 5 against 11g database.

I have a tabular form based on a collection that updates the underlying tables when submitting.  In this tabular form I have some mult-select list boxes.  For example:

apex_item.hidden (3, C012, NULL, 'f03_'||rownum) || apex_item.select_list_from_query(4, C012, C007, 'multiple="multiple" onChange="selectList(this)"', 'NO', NULL, NULL, 'f04_'||rownum, NULL, 'NO')

The onChange function takes the selected values of the list box and strings them together ":" delimited and sets the value in the hidden field which is what is later stored in the database table.  This works great:

function selectList(p_this)

{

var l_selected = html_SelectValue(p_this);

if (l_selected.constructor == Array) l_selected = l_selected.join(':');

p_this.parentNode.firstChild.value = l_selected;

return l_selected;

}

My issue is when the tabular form is queried again how do I get the values stored for the multi select list to be displayed in the select list as selected?  I'm guessing I would need to write some kind of function to put in the value for the select list instead of 'C012' (the collection column that contains the ":" delimited string) but I am unsure of how to do this.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2016
Added on Apr 18 2016
11 comments
2,406 views