39
Views
2
Comments
Hot to redirect to a page in a different tab already opened?
Application Type
Traditional Web
Service Studio Version
11.53.16 (Build 61323)

We have one page and when we click on a button a different window it's opened. 

In these second window we have a different button and when we click the goal it's to close this second window and redirect the first one to a different screen.

How can we do that?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You cannot do that. Each web page lives completely isolated from another one. That's a good thing, because it would be a huuuge security risk if pages could just access the content of other pages (say you have your banking site opened and you access a rogue site that gets info from the banking site).

That said, the only thing I can think of is some JavaScript on the first page that periodically clicks a hidden button to call a Screen Action, which reads a database value or calls a REST service to see if it should redirect (and if so, redirects itself). The second screen can then write something in the database when it's closed to signal the first screen it should redirect.

2021-08-12 05-19-40
Shubham Janbandhu

Hi Nuno Pardal, 

Yes, I agree with @Kilian Hekhuis , you need to maintain the security for the screens.

But still if you would like to try this, you can refer this example.

Created 3 screens, Screen4, Screen5, and Screen6 where Screen5 is first page with "New Window" button when you clicked on this Screen6 will be open and have one button called "Goal", and once you just clicked on this button Screen6 itself will be closed and it lands to parent screen called Screen5 and automatically redirect to different screen called "Screen4" as per your requirement.   

            

Logic needs to implement in Screen6 only, use the JavaScript.

1. 

2.

Using RequestDomain will get ex- "personal-xxxxxxxxxx.outsystemscloud.com", getOwnerUrlPath will return the path ex- "/Javascript/" as per this module and finally assigned all this to Local var "Domain_OwnerURL". It is like Domain_OwnerURL  = "personal-xxxxxxxxxx.outsystemscloud.com/Javascript/" and add screen name at last "Screen4" as per 2nd screen shoot.

Hope this will helps.

Best Regards, 

Shubham

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.