Open a new Browser Tab from RPG

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Open a new Browser Tab from RPG

Post by dieter »

Hello,
we want to call a web application in a new browser tab from our RPG-program. Is is no problem to do this by adding a javascript code to a button on our screen, e.g. window.open(getElementValue("link")). The variable/element "link" contains the url of the application we want to call.
This works great as long as a user clicks on our button. But we wish to call our application directly from an RPG-program. Our idea was the following: We write a RPG-tool which has a profoundUI screen. On this screen there ist only a hidden textbox, which gets the url, we want to call. In the Onload event of the screen we call the url by using "window.open" and with a pui.Click() we end our tool: window.open(getElementValue("link"));pui.click();
This works, but the called application is shown in a complete new window. It is not opened in a tab of the current browser. And the new window has not the same properties like the current browser window. With google we found out, that window.open allways opens new windows if it is triggered by a programatic call instead of an user action. Is there any trick to tell the profoundUI screen, that there was a user action? A script like pui.Click("Button1") does this not. It seems to be, that pui.Click("Button1") does not really click the button. It tells the RPG-application that Button1 is clicked, but the element "Button1" is not really involved. Do i understand that right?

Dieter
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Open a new Browser Tab from RPG

Post by Alex »

It may not be possible to accomplish what you want from the onload event. I believe the browser has no way of knowing whether the user actually clicked something or not to cause this code to run.

You may just need to rework the logic so that window.open() is actually called from an onclick event.
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Open a new Browser Tab from RPG

Post by dieter »

Thank you for your answer. We will try to solve the problem by changing the logic.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests