valramosr Posted October 31, 2017 Share Posted October 31, 2017 Hi, I need to open a pdf in another browser tab. How do I do? Use like that! UniURLFrame2.URL:='/files/PDFs/'+FormatDateTime('ddmmyyyyhhmm', Now)+'myfirstrel.pdf'; but opens on the same tab. Quote Link to comment Share on other sites More sharing options...
valramosr Posted October 31, 2017 Author Share Posted October 31, 2017 Thanks!! VAR URL:String; URL:='/files/PDFs/'+FormatDateTime('ddmmyyyyhhmm', Now)+'myfirstrel.pdf'; UniSession.AddJS('window.open("'+URL+'")'); Only Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted October 31, 2017 Share Posted October 31, 2017 http://forums.unigui.com/index.php?/topic/9353-open-form-in-new-browser-tab/ check also if your file is accessible: '/files/PDFs/'+FormatDateTime('ddmmyyyyhhmm', Now)+'myfirstrel.pdf'; UniSession.AddJS('var newWin = window.open("'+URL+'"); '+ 'if(!newWin || newWin.closed || typeof newWin.closed==''undefined'') '+ '{ alert(''Atenção, os pop-ups para esta página estão bloqueados!'');} '); Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted October 31, 2017 Share Posted October 31, 2017 let the unigui generate the link: UniServerModule.NewCacheFileUrl(False, 'pdf', FormatDateTime('ddmmyyyyhhmm', Now)+'myfirstrel, '', URL); UniSession.AddJS('var newWin = window.open("'+URL+'"); '+ 'if(!newWin || newWin.closed || typeof newWin.closed==''undefined'') '+ '{ alert(''Atenção, os pop-ups para esta página estão bloqueados!'');} '); 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.