2
votes

I am using Oracle Apex 5. On the page i have two items that are filled out (dynamic actions automatically refresh an interactive report based on the values of those two items).

Also i have a button PRINT which is supposed to open a new page and send the values of the two items. Since i want this new page to open in a new window(tab) i am doing it by making the action of the button redirect to url and entering this Javascript in the url:

javascript:var myWindow = window.open('f p=800:105:&APP_SESSION.::NO::REP_NAME,PAR1_NAME,PAR1_VAL,PAR2_NAME,PAR2_VAL:NarudzbenicaDobavljacV2,P_ACCOUNT_ID,&P15_SUPLIER_ID.,P_DATE,&P15_DATE.');

Here is the catch! The function doesn't pick up the values. Only after a page submit or refresh (F5) does it work. How to make it work without having to do this?

I also tried making the button a submit page action and adding an after submit branch with the same javascript, but this just throws a 500 error.

2

2 Answers

0
votes

In javascript you need to use the function $v() to get the item value. The &PX_ITEM. notation doesn't work like that, this uses the session values stored in the database (which are set upon page submition or by a pl/sql block setting the session state). You need to set the url like this:

javascript:var myWindow = window.open('f?p=800:105:&SESSION.::NO::REP_NAME,PAR1_NAME,PAR1_VAL,PAR2_NAME,PAR2_VAL:NarudzbenicaDobavljacV2,' + $v('P_ACCOUNT_ID') + ',' + $v('P15_SUPLIER_ID') +',' +$v('P_DATE') + ',' + $v('P15_DATE')');
0
votes

If this question is still open try this:

javascript:var myWindow = window.open('f?p=800:105:&SESSION.::NO::REP_NAME,PAR1_NAME,PAR1_VAL,PAR2_NAME,PAR2_VAL:NarudzbenicaDobavljacV2,P_ACCOUNT_ID,' + $v("P15_SUPLIER_ID") +',P_DATE,' + $v("P15_DATE"));