Button Redirect to New Tab Window Question
956009Jan 3 2013 — edited Jan 4 2013I would like to have a button that when clicked once, redirects the page to a URL in a new tab. The URL is based on a sql query from a dynamic action linked to the button.
Way 1:
I have tried to use redirect_url() in the dynamic action itself.
<pre>
htp.init;
owa_util.redirect_url('http://myurl.com');
</pre>
But it didn't work at all.
So I tried ...
Way 2:
1. In the dynamic action set a page item value to the url. This is Action 1 of the dynamic action.
<pre>
:P33_URL_ITEM := function_that_returns_the_url;
</pre>
2. Submit the page. This is Action 2 of the dynamic action.
3. Action 3 of the dynamic action executes the following JavaScript code:
<pre>
window.location.href="&P33_URL_ITEM.";
</pre>
However, the problem is P33_URL_ITEM is not set the first time (or whenever the session is cleared), so that the button has to be clicked twice in order for the page to be redirected.
Not-important question: Does anyone know how to fix it so that only 1 click is needed?
Way 3:
Use APEX Branch.
Important question: Does anyone know how to make the branch open the URL in a new page?
Thanks