Page 1 of 1

Open New Window in Profound UI

Posted: Fri Mar 15, 2013 11:17 am
by bruceanthony
We are currently placing PDF’s within an iFrame but prefer to have the PDF’s open in a new window outside of an iFrame.

I Have two questions.

Question 1:

Does PROFOUNDUI

pui.openURL("http://www.google.com");

or

pui.link("http://www.google.com");

open a new window in the same way the following html code would open a new window?

<h3 align="center"> <a href="http://www.google.com" target="_blank">Google Home Page</a></h3>

Question 2:

Can pui.openURL(http://www.google.com) be called from RPG in addition to using it on the client side. Is there anything on the server side that can be called that will perform the same function as pui.openURL("http://www.goog.com") ? A server side solution would be extremely helpful as the PDF’s have dynamic/unique names and only live for 2 to 2.5 minutes before they are deleted.

Re: Open New Window in Profound UI

Posted: Fri Mar 15, 2013 11:22 am
by Alex
pui.link() will not open a new window.

But pui.openURL() will. pui.openURL() is equivalent to the JavaScript’s window.open() method.

Unfortunately, It is not possible to call this directly by RPG code. However, the RPG code could perhaps refresh the screen and output a flag or a URL variable that will tell the JavaScript to call this. Your JavaScript code may then be assigned to the screen's onload event and look like this:

Code: Select all

If (get("FLAG") == "1") pui.openURL(get("URL"));

Re: Open New Window in Profound UI

Posted: Mon Apr 29, 2013 4:49 pm
by swushw
When a subfile is involved, how do you get it to return the value "URL" from a selected row?

Thanks.

Re: Open New Window in Profound UI

Posted: Tue Apr 30, 2013 10:27 am
by Scott Klement
In a subfile, each field ID on the screen has a number appended to it. So, to get the URL from the top row, you'd code get("URL.1"), the second row would be get("URL.2"), etc.

If you have the row number in a variable, you can concatenate them. get("URL." + row);

Re: Open New Window in Profound UI

Posted: Tue Apr 30, 2013 12:46 pm
by swushw
Thanks Scott.