Open a new Browser Tab from RPG
Posted: Thu Oct 04, 2012 8:07 am
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
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