Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inconsistent behaviour between overloaded versions of NewWindow
#1
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.
Reply
#2
Hi Ian, how about show this text file in a IWMODALwindow? See this demo.
Reply
#3
(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. Heart

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! Rolleyes
Reply
#4
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
Reply
#5
Hi Alexandre,

You believe correctly, woDefault, is the window option I was missing. With that it works exactly as I was hoping. Cool

Thank you very much for your help.

Ian.
Reply
#6
you're welcome! Thanks for the feedback!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)