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!

pl/sql javascript via htp.p problem

30790Nov 18 2009 — edited Nov 24 2009
I've a page process that I wish to trigger to delete an order if a user has removed all items from said order while modifying it. I would like to implement a javascript pop up to notify them that if they continue, their order will be deleted and if they acknowledge yes, redirect them to page 4.

What I'm doing is not quite working. I get the pop up, but the calling page "disappears" (browser screen is blank save for the confirm box) and if the user answers yes, the redirect does not work. If they answer no, the order is deleted anyway.

How do I preserve the view of the calling page?
How do I fix the redirect?
How might I exit the script from within the HTP.p javascript?

Thanks!

Paul
declare 
   counter number := 0;
begin
   select count(*) into counter
   from SM_INVENTORY_ORDER
   where ORDER_ID = :F111_MODIFYING_ORDER;

   if counter = 0
   then
      HTP.p ('<script type="text/javascript">');
      HTP.p ('if (confirm("Confirmation Message")) redirect(''f?p=&APP_ID.:4:&APP_SESSION.'');');
      HTP.p ('</script>');
      delete from SM_ORDER
      where ORDER_ID = :F111_MODIFYING_ORDER;
      :F111_MODIFYING_ORDER := null;
   end if;

end;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2009
Added on Nov 18 2009
29 comments
8,060 views