How to pull window to the foreground - Window Focus

How to pull window to the foreground - Window Focus

am 27.07.2009 14:31:23 von Patrick Moloney

I have a web page with a button that displays additional information for
the user. It does a Window.Open to create a "popup" window, then
populates it.

If the user goes back to the web page without closing the window, it
often goes behind the browser and is not visible (which is not the
problem). But if the user selects the button again, nothing appears to
happen because the window remains behind the browser, although it is
updated.

The popup window has its own source file that populates it. I'd like to
add a Window.Focus at the end of the population process. That should
move the popup window to the foreground whenever it is refreshed. I
can't get the code to actually do that. How can I make that popup window
have focus?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 15:08:18 von Phpster

On Mon, Jul 27, 2009 at 8:31 AM, WebPat wrote:
> I have a web page with a button that displays additional information for the
> user. It does a Window.Open to create a "popup" window, then populates it.
>
> If the user goes back to the web page without closing the window, it often
> goes behind the browser and is not visible (which is not the problem). But
> if the user selects the button again, nothing appears to happen because the
> window remains behind the browser, although it is updated.
>
> The popup window has its own source file that populates it. I'd like to add
> a Window.Focus at the end of the population process. That should move the
> popup window to the foreground whenever it is refreshed. I can't get the
> code to actually do that. How can I make that popup window have focus?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


in the body tag add an onfocus event



--

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 16:26:28 von Patrick Moloney

Bastien Koert wrote:
> On Mon, Jul 27, 2009 at 8:31 AM, WebPat wrote:
>> I have a web page with a button that displays additional information for the
>> user. It does a Window.Open to create a "popup" window, then populates it.
>>
>> If the user goes back to the web page without closing the window, it often
>> goes behind the browser and is not visible (which is not the problem). But
>> if the user selects the button again, nothing appears to happen because the
>> window remains behind the browser, although it is updated.
>>
>> The popup window has its own source file that populates it. I'd like to add
>> a Window.Focus at the end of the population process. That should move the
>> popup window to the foreground whenever it is refreshed. I can't get the
>> code to actually do that. How can I make that popup window have focus?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> in the body tag add an onfocus event
>
>
>

That was just what I need. Thanks.
However, I first tried it in Firefox and it did not work.
Eventually gave it a try in IE7 and it works just fine! Maybe something
wrong with Firefox. I have Firebug available in Firefox. It reported
"Prototype undefined" for this event. Not sure if that means in Firebug
or Firefox.
Anyway, I'll leave it at that and be happy with your help. Thanks again.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 16:36:35 von Andrew Ballard

On Mon, Jul 27, 2009 at 10:26 AM, WebPat wrote:
> Bastien Koert wrote:
>>
>> On Mon, Jul 27, 2009 at 8:31 AM, WebPat wrote:
>>>
>>> I have a web page with a button that displays additional information for
>>> the
>>> user. It does a Window.Open to create a "popup" window, then populates
>>> it.
>>>
>>> If the user goes back to the web page without closing the window, it
>>> often
>>> goes behind the browser and is not visible (which is not the problem).
>>> But
>>> if the user selects the button again, nothing appears to happen because
>>> the
>>> window remains behind the browser, although it is updated.
>>>
>>> The popup window has its own source file that populates it. I'd like to
>>> add
>>> a Window.Focus at the end of the population process. That should move the
>>> popup window to the foreground whenever it is refreshed. I can't get the
>>> code to actually do that. How can I make that popup window have focus?
>>>
>>
>>
>> in the body tag add an onfocus event
>>
>>
>>
>
> That was just what I need. Thanks.
> However, I first tried it in Firefox and it did not work.
> Eventually gave it a try in IE7 and it works just fine! Maybe something
> wrong with Firefox. I have Firebug available in Firefox. It reported
> "Prototype undefined" for this event. Not sure if that means in Firebug or
> Firefox.
> Anyway, I'll leave it at that and be happy with your help. Thanks again.
>

A lot of sites are moving to simulated dialog windows inside the page.
They have a few nice benefits:

1) Since they aren't real windows, they do not interfere with other
tabs or windows you have open in your browser.

2) Since they are actually part of the page itself, they will always
either stay on top of the other page elements or else they will
automatically close (whichever effect is desired).

3) They are not actual pop-up windows, so they won't be blocked by
pop-up blockers.


Granted, they depend on JavaScript, but then so did your other approach.


http://www.google.com/search?q=div+popup+window


Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 17:39:26 von Patrick Moloney

Andrew Ballard wrote:
>
> A lot of sites are moving to simulated dialog windows inside the page.
> They have a few nice benefits:
>
> 1) Since they aren't real windows, they do not interfere with other
> tabs or windows you have open in your browser.
>
> 2) Since they are actually part of the page itself, they will always
> either stay on top of the other page elements or else they will
> automatically close (whichever effect is desired).
>
> 3) They are not actual pop-up windows, so they won't be blocked by
> pop-up blockers.
>
>
> Granted, they depend on JavaScript, but then so did your other approach.
>
>
> http://www.google.com/search?q=div+popup+window
>
>
> Andrew

Thanks, I hadn't thought about that approach. It's certainly an alternative.
I think I have come across some of them on various sites, but I've found
them to be quite disagreeable. As you scroll, they often scroll down,
then float back to their assigned position. Weird. And they are usually
blocking something that I want to see.

I don't know if what I'm doing is javascript or not. I never have that
identifier on my web page. I do call the Window.Open (function?), so, if
that counts then yeah. But I like the separate window better. The user
can more easily move it out of the way - even off the browser window -
and continue reading the main page while referring to the popup window.
I'd actually like to allow the user to create multiple popup windows,
which I create from buttons on my webpage, but right now they all go to
the same window, and I've had enough trouble trying to get that to work.
I'm there now with that last Window.Focus detail - except that
Firefox seems to be having a problem with that. But, I'm not going to
worry about that. So, for now I'm good.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 17:46:48 von Phpster

On Mon, Jul 27, 2009 at 11:39 AM, WebPat wrote:
> Andrew Ballard wrote:
>>
>> A lot of sites are moving to simulated dialog windows inside the page.
>> They have a few nice benefits:
>>
>> 1) Since they aren't real windows, they do not interfere with other
>> tabs or windows you have open in your browser.
>>
>> 2) Since they are actually part of the page itself, they will always
>> either stay on top of the other page elements or else they will
>> automatically close (whichever effect is desired).
>>
>> 3) They are not actual pop-up windows, so they won't be blocked by
>> pop-up blockers.
>>
>>
>> Granted, they depend on JavaScript, but then so did your other approach.
>>
>>
>> http://www.google.com/search?q=3Ddiv+popup+window
>>
>>
>> Andrew
>
> Thanks, I hadn't thought about that approach. It's certainly an alternati=
ve.
> I think I have come across some of them on various sites, but I've found
> them to be quite disagreeable. As you scroll, they often scroll down, the=
n
> float back to their assigned position. Weird. And they are usually blocki=
ng
> something that I want to see.
>
> I don't know if what I'm doing is javascript or not. I never have that
> identifier on my web page. I do call the Window.Open (function?), so, if
> =A0that counts then yeah. But I like the separate window better. The user=
can
> more easily move it out of the way - even off the browser window - and
> continue reading the main page while referring to the popup window.
> I'd actually like to allow the user to create multiple popup windows, whi=
ch
> I create from buttons on my webpage, but right now they all go to the sam=
e
> window, and I've had enough trouble trying to get that to work. =A0I'm th=
ere
> now with that last Window.Focus detail - except that Firefox seems to be
> having a problem with that. But, I'm not going to worry about that. So, f=
or
> now I'm good.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

If they are all going to the same window, its likely that you have a
window.open function that names the window. When the window has a
name/id, then any subsequent calls to the window open command will
re-use the same window. if you remove the id attribute (the call is
usually window.open(url,id,parameters) and substitute an empty string
( '' ) then it should open new windows.

Back to the DIVs option, you can write js controls that make the
window dragable, hidable etc to improve the users enjoyment of the
page

--=20

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 18:04:37 von Andrew Ballard

On Mon, Jul 27, 2009 at 11:46 AM, Bastien Koert wrote:
> Back to the DIVs option, you can write js controls that make the
> window dragable, hidable etc to improve the users enjoyment of the
> page
>
> --
>
> Bastien
>

Some implementations are definitely better than others. Like any other
software, you just have to take some time to try out different
versions and find the one that has the features that you want for the
price you're willing to pay, or else try your hand at writing your
own.

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 19:09:45 von Patrick Moloney

Bastien Koert wrote:
> On Mon, Jul 27, 2009 at 11:39 AM, WebPat wrote:
>> Andrew Ballard wrote:
>>> A lot of sites are moving to simulated dialog windows inside the page.
>>> They have a few nice benefits:
>>>
>>> 1) Since they aren't real windows, they do not interfere with other
>>> tabs or windows you have open in your browser.
>>>
>>> 2) Since they are actually part of the page itself, they will always
>>> either stay on top of the other page elements or else they will
>>> automatically close (whichever effect is desired).
>>>
>>> 3) They are not actual pop-up windows, so they won't be blocked by
>>> pop-up blockers.
>>>
>>>
>>> Granted, they depend on JavaScript, but then so did your other approach.
>>>
>>>
>>> http://www.google.com/search?q=div+popup+window
>>>
>>>
>>> Andrew
>> Thanks, I hadn't thought about that approach. It's certainly an alternative.
>> I think I have come across some of them on various sites, but I've found
>> them to be quite disagreeable. As you scroll, they often scroll down, then
>> float back to their assigned position. Weird. And they are usually blocking
>> something that I want to see.
>>
>> I don't know if what I'm doing is javascript or not. I never have that
>> identifier on my web page. I do call the Window.Open (function?), so, if
>> that counts then yeah. But I like the separate window better. The user can
>> more easily move it out of the way - even off the browser window - and
>> continue reading the main page while referring to the popup window.
>> I'd actually like to allow the user to create multiple popup windows, which
>> I create from buttons on my webpage, but right now they all go to the same
>> window, and I've had enough trouble trying to get that to work. I'm there
>> now with that last Window.Focus detail - except that Firefox seems to be
>> having a problem with that. But, I'm not going to worry about that. So, for
>> now I'm good.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> If they are all going to the same window, its likely that you have a
> window.open function that names the window. When the window has a
> name/id, then any subsequent calls to the window open command will
> re-use the same window. if you remove the id attribute (the call is
> usually window.open(url,id,parameters) and substitute an empty string
> ( '' ) then it should open new windows.
>
> Back to the DIVs option, you can write js controls that make the
> window dragable, hidable etc to improve the users enjoyment of the
> page
>

You are correct, the Open names the window. That is done in the Onclick
of the button and becomes the Target for an . I need a name for the
Target. This works pretty good. I'm not sure many users would open more
than one anyway - at least not without getting even more confused.
Probably better.

I've tried to build this with Html and CSS, and just a little PHP.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 19:29:24 von Richard Heyes

Hi,

> A lot of sites are moving to simulated dialog windows inside the page.

There's an updated version of my ModalDialog included in RGraph which
does just this:

http://www.rgraph.net/docs/external.html

It covers the page in a semi transparent DIV to bring attention to
itself (the modal part). It beats the crappy confirm() dialogs. The
older version is here:

http://www.phpguru.org/static/Modal-Dialog.html

--
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 25th July)
Lots of PHP and Javascript code - http://www.phpguru.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to pull window to the foreground - Window Focus

am 27.07.2009 20:37:18 von Patrick Moloney

Richard Heyes wrote:
> Hi,
>
>> A lot of sites are moving to simulated dialog windows inside the page.
>
> There's an updated version of my ModalDialog included in RGraph which
> does just this:
>
> http://www.rgraph.net/docs/external.html
>
> It covers the page in a semi transparent DIV to bring attention to
> itself (the modal part). It beats the crappy confirm() dialogs. The
> older version is here:
>
> http://www.phpguru.org/static/Modal-Dialog.html
>

But why are we moving to commercial software to do something as simple
as I'm trying to do here?
I'm not against commercial software in general - I own my own commercial
software business full-time.
Your dialog might be great and really useful in some situations, with
plenty of benefits. But, it's a big decision to include ANY software
package into any project. There are learning curves, questions about who
will be skilled to support it in the future, cost (?), versions,
upgrades, survival etc.
And I have to say, as a user, I am very disappointed with many sites
that have obviously included all the latest and greatest technology.

Perhaps there is a need for change. And maybe the development of these
alternate solutions will encourage the standards powers that be to take
a new look at the need for a solution within standards.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php