Atozed Forums
Inconsistent behaviour between overloaded versions of NewWindow - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Inconsistent behaviour between overloaded versions of NewWindow (/thread-639.html)



Inconsistent behaviour between overloaded versions of NewWindow - Ian_F1 - 09-07-2018

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.


RE: Inconsistent behaviour between overloaded versions of NewWindow - Jose Nilton Pace - 09-07-2018

Hi Ian, how about show this text file in a IWMODALwindow? See this demo.


RE: Inconsistent behaviour between overloaded versions of NewWindow - Ian_F1 - 09-07-2018

(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


RE: Inconsistent behaviour between overloaded versions of NewWindow - Alexandre Machado - 09-08-2018

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


RE: Inconsistent behaviour between overloaded versions of NewWindow - Ian_F1 - 09-10-2018

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.


RE: Inconsistent behaviour between overloaded versions of NewWindow - Alexandre Machado - 09-10-2018

you're welcome! Thanks for the feedback!