简体   繁体   中英

Oracle Apex 5 Opening page in new window

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.

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')');

如果此问题仍然存在,请尝试以下操作:

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"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM