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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Ajax - Multiple Values - Help with the code

737666Dec 3 2009 — edited Mar 1 2010
Hi all,

My code is probably wrong, though, I don't know where the problem is. I'm not that good with programming and copied the example from oracle.com and modified it... I hope you guys can help me. Here is what I have:

A select list: P4_DOBJ1_NR (The user selects something from DOBJ_NR from the table dataobject)
A display as text item: P4_NAMSP1
Another display as text item: P4_DOBJ_NAME1


Here my code:



HTML Header Setting for my select list-attribut:

onchange="javascript:getDOBJ1Info(this);"



The HTML header from my page:

<script type="text/javascript">
function getDOBJ1Info(filter)
{
var xml = null;
var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=GETDOBJ1Info',0);
get.add('GOBJ1NO', filter.value);
ret = get.get('XML');
if(ret)
{
var oneItems = ret.getElementsByTagName("NAMSP");
if (oneItems)
{
var onedisplay = document.getElementById("P4_NAMSP1");
onedisplay.innerHTML = oneItems[0].getAttribute("VALUE");
}
var twoItems = ret.getElementsByTagName("DOBJ_NAME");
if (twoItems)
{
var twodisplay = document.getElementById("P4_DOBJ_NAME1");
twodisplay.innerHTML = twoItems[0].getAttribute("VALUE");
}
}
get = null;
}
</script>


An application item, called: GOBJ1NO



And the Application Process:

DECLARE
vONE VARCHAR2(100);
vTWO VARCHAR2(100);
BEGIN
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<DATA>');
SELECT NAMSP, DOBJ_NAME INTO vONE, vTWO FROM DATAOBJECT WHERE DOBJ_NR = :GOBJ1NO;
htp.prn('<ONE VALUE="' || vONE || '"></ONE>');
htp.prn('<TWO VALUE="' || vTWO || '"></TWO>');
htp.prn('</DATA>');
EXCEPTION WHEN OTHERS THEN
htp.prn('<ONE VALUE="Error"></ONE>');
htp.prn('<TWO VALUE="Error"></TWO>');
END;
This post has been answered by thomaso on Dec 3 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2010
Added on Dec 3 2009
5 comments
748 views