|
<< Click to Display Table of Contents >> Navigation: Forum > Inconsistent behaviour between overloaded versions of NewWindow |
09-07-2018, 09:59 AM:
Hi,
I'm using Intraweb 14.2.7 to display a text file in a new tab and it works fine using this command (if the user does not have pop-ups blocked obviously):
Code:
WebApplication.NewWindow( webapplication.ApplicationURL + '/mytextfile.txt', '', -1, -1 );
If pop-ups are blocked then it's not very obvious to the user why the text file didn't open and so I would like to display a helpful message. If I change my command to the following I do get a helpful message but then it will display the text file in a new window not in a new tab
Code:
WebApplication.NewWindow( webapplication.ApplicationURL + '/mytextfile.txt', '', -1, -1, [ woDetectBlock ] );
So, how can I add pop-up detection and display the text file in a new tab and not in a separate window?
Or, to put it another way:
Why does the following display a file in a new tab
Code:
WebApplication.NewWindow( webapplication.ApplicationURL + '/mytextfile.txt', '', -1, -1 );
But this one displays it in a window?
Code:
WebApplication.NewWindow( webapplication.ApplicationURL + '/mytextfile.txt', '', -1, -1, [] );
Many thanks in anticipation
Ian.
09-07-2018, 01:53 PM:
Hi Ian, how about show this text file in a IWMODALwindow? See this demo.
09-07-2018, 02:32 PM:
(09-07-2018, 01:53 PM)José Nilton Pace Wrote: [ -> ]Hi Ian, how about show this text file in a IWMODALwindow? See this demo.
Hi,
Thanks for the reply. I was not familiar with this particular demo and having played with it I like what I see.
However, for this project the users specifically want the file displayed in a separate tab, not one file overlaying the current screen so they can open more than one at the same time. They're very particular!
09-08-2018, 02:13 AM:
Hi Ian,
basically because this
Code:
WebApplication.NewWindow( webapplication.ApplicationURL + '/mytextfile.txt', '', -1, -1 );
is exactly the same as this:
Code:
WebApplication.NewWindow( webapplication.ApplicationURL + '/mytextfile.txt', '', -1, -1, [woDefault] );
Possible combination of options (the last parameter) are:
TIWWindowOption = (
woButtons, woStatusBar, woMenuBar, woScrollBars, woResizable,
woCopyHistory, woFullScreen, woDetectBlock, woDefault);
So, I believe you are looking for this:
Code:
WebApplication.NewWindow('http://www.atozed.com', '', -1, -1, [woDefault, woDetectBlock]);
Which will use the default option but still keeping the popup blocker detection in place
09-10-2018, 07:57 AM:
Hi Alexandre,
You believe correctly, woDefault, is the window option I was missing. With that it works exactly as I was hoping.
Thank you very much for your help.
Ian.
09-10-2018, 10:37 PM:
you're welcome! Thanks for the feedback!