Manage Learn to apply best practices and optimize your operations.

Open PDF attachments in new window

When using the standard upload control in Domino, all links are set to open up
in the current window. Problems can occur with PDF's and other file formats
that should be open full screen or in a new window. This tip will allow you
to control which attachments open up in the current window by changing
the "target" property of the link using Javascript.

Place the "replaceTarget" function in the JSHeader.

Call the function in the form onLoad event. Such as: replaceTarget(".PDF");

function replaceTarget(whichExtension){
 whichExtension=whichExtension.toUpperCase();  //convert to upper case
 for (i = 0; i < document.links.length; i++){  // loop through all links on current document
    currenthref=document.links[i].href;   // get the first href of the link
    currenthref=currenthref.toUpperCase();   //convert to upper case
    linkMatch=currenthref.indexOf(whichExtension);  //look for the extension in the current link<r>
    if (linkMatch>-1)         //is it a match?
      document.links[i].target = "_blank"; //replace the target with a blank window target
    }
}

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close