473,804 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PopUp Focus - How To?

Dear Group

I wondered whether you can help me with this. I do have a page that
contains a button and an IFrame. The IFrame contains a dummy page that
is set to redirect to a word document when loaded so eventually the
word document will be displayed in the IFrame. That works all well. No
problem.

The only trouble I have is with the button contained on the parent
page. When pressed, it runs this script:

<script language=JavaSc ript>
window.open('do wnload.aspx','d ownload','width =320,height=150 ,resizable=no,s crollbars=no'); </script>

which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That's ok) but then triggers the dummy page to
load the document which will give the focus to the paren page. So the
pop-up is only shown for a second in the foreground and then
disappears.
I have tried placing a window.focus(ne wwindow) script on the dummy page
but then I can't see the pop-up at all. I might do something wrong with
the window.focus script as I'm not so good in Java.
If you have any ideas, please let me know.

Thank you very much for your help & efforts!
Have a nice day!

Martin

Jul 23 '05 #1
13 2086
Ivo
<th************ @hotmail.com> wrote
The only trouble I have is with the button contained on the parent
page. When pressed, it runs this script:

<script language=JavaSc ript>
window.open('do wnload.aspx','d ownload','width =320,height=150 ,resizable=no,s c
rollbars=no');</script>

Why should your popup be unresizable? There really is no excuse for
disabling this window feature, simply because those visitors that don't try
to resize the window will never notice a difference, and those that do try
it, for whatever unthought of circumstance, will only find that they can't!
Give me one good reason!
which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That's ok)


Haven't seen enough of your code, but I don't see why a reload would
unavoidable. Anyway, to focus the popup from the opener, you need to assign
a reference via the open() statement like so:

var w=window.open( 'stuff', 'stuff', 'stuff' );
w .focus();

hth
--
ivo
Jul 23 '05 #2
In article <11************ **********@c13g 2000cwb.googleg roups.com>,
th************@ hotmail.com enlightened us with...
So the
pop-up is only shown for a second in the foreground and then
disappears.


Did you try: (watch for word-wrap!)

<script type="text/javascript">
// note that the language attribute is deprecated: use type

var w = window.open('do wnload.aspx','d ownload','width =320,height=
150,resizable=n o,scrollbars=no ');
if (w != null) w.focus();

</script>

--
--
~kaeli~
Jesus saves, Allah protects, and Cthulhu thinks you'd make
a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
theintrepid...@ hotmail.com wrote:

(snip)
...the button contained on the parent
page....runs this script:
(snip)
which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That's ok) but then triggers the dummy page to load the document which will give the focus to the paren page. So the
pop-up is only shown for a second in the foreground and then
disappears.


(snip)

Wow, that's as clear as mud. Why does the "button click unavoidable
[sic]
reloads the parent page" ? If it's a <button> button, try this:

<button...oncli ck="funcName(); return false;">

Otherwise, try this in 'download.aspx' :

<script type="text/javascript">

self.focus();

</script>

Jul 23 '05 #4
Ivo

First, thanks very much for your reply.
But may you want to have a look out of your box next time before
starting patronizing.
It's an aspx application and if I don't want someone to resize a window
then there's a very good reason for it. And if I say a reload is
unavoidable then this is also carved in stone! You java people and your
attitude. Argh! Anyway, tried your suggestion before and it doesn't
work.

Jul 23 '05 #5
Hi Kaeli

Thanks very much for your help.
Yes I tried that. Even on a simple test page with two buttons. One
opens the popup and the other one gives the focus to it with the code
you suggested. However I always get a variable null error. Thought the
variable is global and should have a value if I did everything like you
say? Any ideas?

Thanks for your efforts!

M

Jul 23 '05 #6
Hi Rob

Thanks for your post!
Well, it's an aspx application that will need to post back when the
button is clicked. It's not just a button but a toolbar control and
that how it works. So everytime the button is clicked it executes the
javascript to open the popup (which will come up for a second) but
because the page reloads it also reloads the frame with the dummy page
that will then reload the word document and the parent page gets the
focus again!

Have tried your suggestion and it doesn't work because the frame reload
happens after the popup comes up so this will be after the popup focus
event has happened. Tried placing a timer in the popup to execute the
javascript after e.g. five seconds (when the frame finished loading)
but still no luck.

Have a nice day!

M

Jul 23 '05 #7

theintrepid...@ hotmail.com wrote:
It's an aspx application and if I don't want someone to resize a window then there's a very good reason for it. And if I say a reload is
unavoidable then this is also carved in stone! You java people and your attitude. Argh!


Remember that you have no right on usenet to demand to have your
questions answered under your terms.

Jul 23 '05 #8
God! Are you all human rights activists? Go back play with your Apple
Mac!

Jul 23 '05 #9
God! Are you all human rights activists? Go back play with your Apple
Mac!

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3000
by: Mica Cooper | last post by:
Hi, I have a series of Select menus on a page. I am trying to allow the user to click on the Select title and have it popup a help window. This works fine with the following code except that all the Select choices are lost. <A HREF="javascript:location='menu.jsp';window.open('menuhelp.jsp?menuID=5','me nuhelp',)">MenuTitle</A> I saw an example of a popup on a website that did not lose the menu choices.
5
11583
by: Willem van Isselmuden | last post by:
Hello, I've a problem I hava a page with different popup windows, when I hit a link the first one pops up and with the first open i would like to hit the second link in the parent page so the second links pops up a window in the first popup. The way I have it now is working but with each link the size of the popup window should be different but that doesnt happen how can I solve that problem?
2
3774
by: Moist | last post by:
Hi, first I must admit this is one of the most active group I have ever seen. For my question: is it possible to create a small popup window that remain in focus until it is closed. That is, even if you click on the main (caller) window just beside the popup, the popup would remain in focus. I've tried "alwaysRaised" with window.open() function but it doesn't work, must be for something else!!!
2
1437
by: Kevin Lam | last post by:
Hi all, I am writing an application which requires using a popup windows to edit the detail of a record. The popup windows is created by it's parent which shows the detail of the record, which also has a button to delete the record. My question is that, how do I make the popup to stay on top of the parent all the time (to make sure, the record is not deleted when I am
4
2435
by: VR | last post by:
First, greetings to everyone :) I'm doing a university seminar & I've encountered a problem. I have a gallery with thumbnails linked on pictures. What I want is popup to be opened with dimensions of linked picture after clicking on a thumbnail. I found javascript which is compatible with IE, Firefox & Opera but I can't get it to work. All I get is this http://www.justfonts.com/tini/problem.html (thumbnail dissapeared).
0
1544
by: Peter Wone | last post by:
I create and position a form containing a popup list à la combobox list. When I either Show() it or set popup.Visible = true it steals the focus. I can put the focus right back where it was but the titlebar of the main form flickers. If I use a flag suppressPopupFlicker and override WndProc to ignore WM_NCACTIVATE just while the popup is being shown then visually I get what I want but the host form then doesn't know it's lost the focus...
0
922
by: theintrepidfox | last post by:
Dear Group Some would think this works but somehow the Focus Button Click Event comes back with a message saying that WindowObjectReference is either NULL or not an object! Both buttons are contained on the same page. Any ideas what's wrong? Tanks for your help and efforts! Have a nice day!
11
7358
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz 1.7.12 (linux kubuntu). It does work with konqueror. It seems to work with firefox on windows but not with IE (not completly sure though).
7
3678
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses pageA.html 2. User clicks on menu link to open popup.html 3. pageA.html checks if popup.html is already open. It is not, open
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.