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!

AJAX callback not working?

705103Jul 8 2010 — edited Jul 8 2010
Hi,
I have an application on apex.oraclecorp.com on Apex 4.0 and have issues with ajax callbacks. I see no reason why the statement should work. It doesnt work even if i fire the function from Firebug.


So i have the following steps declare:

On Demand process called NL_GET_AVIDS:
DECLARE
 v_avids varchar2(3000);
BEGIN
  HTP.PRN('IN');
  BEGIN
  select avid 
     into v_avids 
     from news_announcement 
    where news_defid = '261'
      and issue_date = to_char(to_date(apex_application.g_x01,'DD-MON-YYYY'),'MM/DD/YYYY');
   EXCEPTION WHEN no_data_found then v_avids:='ERR';
  END;
     HTP.PRN(v_avids);
END;
The Javacsript function
<script language="JavaScript" type="text/javascript">
function fetchAvids(pDate)
{
 if($('#P123_NEWSLETTERID').val() == '261')
 {
      var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=NL_GET_AVIDS',$v('pFlowStepId'));
      get.addParam('x01', pDate);
      var pHtml = get.get();
      get = null;
     
   if (pHtml != 'ERR')
   {
     $('#P123_AVID').val(pHtml);
   }
 }
}
</script>
If i call the function from Firebug i see that the POST:
Parametersapplication/x-www-form-urlencoded
p_flow_id	12674
p_flow_step_id	123
p_instance	23767325855288
p_request	APPLICATION_PROCESS=NL_GET_AVIDS
x01	07-JUL-2010
Source
p_request=APPLICATION_PROCESS%3DNL_GET_AVIDS&p_instance=23767325855288&p_flow_id=12674&p_flow_step_id=123&x01=07-JUL-2010
The AJAX RESPONSE is only : "IN" (the first HTP.PRN but it should also return the result from the SQL. The SQL is correct, if i run it in SQL Commands it works perfect.

Any suggestions please?

I have noticed that sometimes it works , sometimes it doesnt, and i cand figure out why

Kind regards,
Alex
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2010
Added on Jul 8 2010
2 comments
1,551 views