How to restrict a page to one concurrent client

Hello All, Apologies if this has been asked before, but my searched didn’t turn up anything.

My question is twofold:

1 - Is there a way to restrict a page so that it can be open in one client only (concurrently)? Or better yet, if a second one is opened it would sense the first client and set component properties based on that fact.

2 - When you navigate to a page, is there a way (possibly through an even handler) to run a script when the page is opened? I need to be able to check for certain conditions and set component properties based on the status of a tag, or possibly a database query.

Thanks All

[quote=“dfarnes”]Hello All, Apologies if this has been asked before, but my searched didn’t turn up anything.

My question is twofold:

1 - Is there a way to restrict a page so that it can be open in one client only (concurrently)? Or better yet, if a second one is opened it would sense the first client and set component properties based on that fact.

2 - When you navigate to a page, is there a way (possibly through an even handler) to run a script when the page is opened? I need to be able to check for certain conditions and set component properties based on the status of a tag, or possibly a database query.

Thanks All[/quote]

for #1 I would look at maybe writing a 1 to a discrete memory tag when the window is opened. on any button that opens that window, before navigating to that window check to see if the memory tag value is 1, if it is display a message that tells the user that the window is already opened. if it is 0 navigate to the window. just make sure that when the user that has the window locked navigates away from the window use a window closed event handler to write the memory tag back to 0. you may also want to verify that if the user would logout or close the client while the window is currently ope that it would still trigger the window closed script that writes the 0 to the memory tag. I dont remember if it does or not. if it doesnt then you may have to get more elaborate using a client id to do what you are asking.

#2 yes certainly. check out the window event handlers, which is what you would use in my scenario I described above.

Dana, for #1, are you looking at seeing if a window is already open or if a project session is already running?

If the latter, then take a look at system.util.getSessionInfo()

Hi Jordan - The first. I want to know if a page is open in a client and either disallow that page to be opened in a second client or disable properties on the page if it is open elsewhere. Thanks!