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 multiselect on AJAX onchange process

Sunil BhatiaJul 9 2009 — edited Jul 28 2009
Hi all,

I am using a select list with submit P6_MODULE and multiselect P6_SUBS_VAR in my application. When the appropriate location is selected from the select list, the multiselect gets propulated. This is having a page submit process binded. I want to change this into an AJAX page submit.

So wt i did was,
1. Change select list to normal(i.e without submit).
2. Created an on-demand process

declare
arrayValue APEX_APPLICATION_GLOBAL.VC_ARR2;
count1 number := 1;
string1 varchar2(4000);
CURSOR valid_subs IS
select TEMPLATE_SUB from osl.VALID_EMAIL_TEMP_SUBS where web_module = v('P6_MODULE') order by 1;

BEGIN
FOR valid_subs_rec IN valid_subs
LOOP
arrayValue(count1) := valid_subs_rec.TEMPLATE_SUB;
count1 := count1 + 1;
END LOOP;
string1 := apex_util.table_to_string(arrayValue);
htp.prn(string1);

This returns me something like [PWD]:[SURNAME]:[FORENAME]

3. Created a javascript

function f_getSubsString()
{
var get = new htmldb_Get(null,106,'APPLICATION_PROCESS=Valid Substitution String',0);
alert(html_GetElement('P6_MODULE').value);
get.add('P6_MODULE',html_GetElement('P6_MODULE').value)
gReturn = get.get();
alert(gReturn);
var returnArray = gReturn.split(':');
var len=returnArray.length;
for(var i=0; i<len; i++)
{
$x('P6_SUBS_VAR').value = returnArray;
}
get = null;
}

4. And finally calling onchange on select list as onchange="f_getSubsString();"

I am putting up an alert in my javascript to check the returning value from ondemand process and it returns perfectly [PWD]:[SURNAME]:[FORENAME].
But how to put this value in P6_SUBS_VAR which is a multiselect. I want both the display value and return value to be same Eg:

Display Value Return Value
[PWD] [PWD]
[SURNAME] [SURNAME]
[FORENAME] [FORENAME]

I am not able to understand how to finally set the value. Can anyone help me on this?
Thanks a lot
With Regards,
Sunil Bhatia
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2009
Added on Jul 9 2009
3 comments
710 views