sicoobcooplivre Posted August 4, 2022 Share Posted August 4, 2022 @Sherzod Good Morning! Please, when I click on a button, is it possible to open a new tab but stay on current page? Thanks! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 4, 2022 Share Posted August 4, 2022 Hello @sicoobcooplivre What do you mean by saying "on current page"? Quote Link to comment Share on other sites More sharing options...
sicoobcooplivre Posted August 4, 2022 Author Share Posted August 4, 2022 @SherzodI have application "A" that the user uses all day. When it enters this application, I want to open another tab with application "B", but I need application A to remain on display. I'm using UniSession.AddJS('window.open(' But it always automatically switches to application tab "B". Is there a way to keep me in the "A" application tab? Thanks! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 4, 2022 Share Posted August 4, 2022 Sorry, I don't fully understand your case? Quote Link to comment Share on other sites More sharing options...
edbuescher Posted August 4, 2022 Share Posted August 4, 2022 Sounds like he wants to spawn another browser tab, but keep the focus on the original tab without moving focus to the newly spawned tab Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 5, 2022 Share Posted August 5, 2022 (edited) 1-Place an unibutton 2- on uniButton Properties: | ClientEvents | ExtEvents | OnClick function click(sender, e, eOpts) { var a = document.createElement("a"); a.href = window.location.pathname; var evt = document.createEvent("MouseEvents"); //the tenth parameter of initMouseEvent sets ctrl key evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, false, 0, null); a.dispatchEvent(evt); } On Chrome, focus moves to next tab. See other solutions and adapt as you wish. It seems to be no more possible keep in the same table for security reasons in chrome. See below: https://stackoverflow.com/questions/10812628/open-a-new-tab-in-the-background Edited August 5, 2022 by Fred Montier typos Quote Link to comment Share on other sites More sharing options...
Fred Montier Posted August 5, 2022 Share Posted August 5, 2022 (edited) On Firefox, works as you wanted. By the way, your browser should allows this procedure. Other wise, it won't work. Edited August 5, 2022 by Fred Montier Quote Link to comment Share on other sites More sharing options...
sicoobcooplivre Posted August 5, 2022 Author Share Posted August 5, 2022 I'm testing it, and as soon as I'm done, I'll let you know here! Thank you very much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.