[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Controlling other windows with DHTML

I've got two windows (non-framed) that I'd like to switch the focus between using something like

windowName.focus()

Each window has been given a unique name.

Any ideas anyone?
0
moehler
Asked:
moehler
  • 4
  • 3
  • 2
1 Solution
 
nettromCommented:
how did you open the second window?  is the document in the second window on the same domain as the one in the first window?
0
 
robbertCommented:
If the window.opener is still open, you could call a function at him that focusses the appropriate window.
Otherwise, how will window1 know of window3, resp., be able to call it, if it is not the opener?
0
 
moehlerAuthor Commented:
In my scenerio, I have a selection form that creates a WebFocus report in a new window and keeps selection form for running additional reports. I want to do some cleanup on the form window, but then return the focus back to the resultant report.

Does that make sense? Should I provide any additional information?

Thanks
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
robbertCommented:
"but then return the focus back to the resultant report."

window.opener.focus(), after doing some work.

Or is there another issue?
0
 
moehlerAuthor Commented:
But dosn't window.opener.focus() go back to the form? What syntax do I use to go back to the report? I create the report with target="report".
0
 
nettromCommented:
oh.  so you have a window opened named "report", but you haven't got a JavaScript object with it (in other words, you didn't use "window.open()" to open the "report" window)?

you can fetch a handle to the window using:

myWindow = window.open('','report');

and then do:

myWindow.focus();

to get it to front again.
0
 
moehlerAuthor Commented:
Thanks guys. I got it resolved....I actually am using a blur for the selection form after I clean up. Since the form results window is the last window to have focus, the blur of the selection window, gives me the result I am looking for.

Since you both helped me in getting to the answer, I want to delete the question and split it into two...I'll be giving maximum grade so you can both receive 200 points.
Any problems with that? I'll wait for both of you to respond before doing so.
0
 
nettromCommented:
perfectly ok by me. :)
0
 
moehlerAuthor Commented:
Since Robbert has never responded. You get the points.

Thanks for your help.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now