[SmartForms] Force Links To Open In The Current Window

  • 31 March 2016
  • 0 replies
  • 18 views

Userlevel 3
Badge +10


 

Some controls like the Worklist control open their links in a new tab/window with no out-of-the-box way to change this.  Here's a simple script to force all controls using the window.open() method to open in the current window.

Steps:
- Add a hidden, literal Data Label to the Form/View
- Configure an expression for the Data Label with the following text:

 
<script>    var oldOpen = window.open;    window.open = function(URL,name,specs,replace) {        oldOpen(URL,'_self',specs,replace);    }</script>
 

This will overwrite the DOM's window.open() method and force '_self' as the target for opening new pages.



 

0 replies

Be the first to reply!

Reply