Delphi Intraweb: Is there a way to open an url in a new tab without the popup behavior?

890 Views Asked by At

In an Intraweb (VCL for the web) mobile web application I need to redirect the user to a java webapp. I specify that is a java webapp to stress the fact that it is a completely different thing compared to the intraweb webapp.

I would like to achieve the following behaviour:

  1. the user clicks on a button
  2. the java app opens in the browser and uses it, in particular he uses the mobile keboard to type data
  3. the user taps the phone back button
  4. the intraweb application opens in the browser

In Intraweb as far as I know there are two ways to redirect the user:

Method 1) with WebApplication.GoToUrl(javaAppUrl) in this way the history is lost so when the user taps on back he is not able to go back to the intraweb application

Method 2) with WebApplication.NewWindow(javaAppUrl) in this way all seems to work in particular the back button works, but when I try to use the mobile keyboard to type something in the java app the keyboard appears for a moment and then it immediately disappears, I guess this is because somehow NewWindow "Creates a new popup window when executed in the browser context".

NewWindow has also some override methods with different parameters list but no one allows to remove the "popup behavior".

Could you please suggest a way to achieve opening a new webapp in a mobile browser:

  1. keeping the browser history
  2. being able to use the mobile keyboard in the just opened app ?

I use Delphi 10 Seattle, Intraweb 14.2.7 and cgdevtools for the mobile part (cgdevtools anyway plays no role in this issue).

Thank you.

1

There are 1 best solutions below

0
On

I implemented a workaround by passing in the URL the webapp URL so that in the java URL I display a button that closes the session and redirects the user to the intrawebapp

javaAppUrl:= javaAppUrl + '&BACK_URL=' + WebApplication.FullApplicationURL(WebApplication.Request);
WebApplication.GoToUrl(javaAppUrl); 

in this way I have the benefit of GoToUrl (so mobile keyboard works) and I manage to have a back feature with a custom button.

By the way this is still a workaround, I need this since I must release the application, but it is not the perfect solution yet.