Solved

Many parent windows affect values in one child window

Posted on 2003-12-01
7
541 Views
Last Modified: 2006-11-17
Dear all,
    How can I have more than one parent window to affect a child window. I plan to have hyperlink in parent window, which when click on can transfer values into the child window. Can I have cases where i have more than one parent window with hyperlinks in it, and no matter which parent window I click, the values will eventually be transfer into the child window???
  Can this be done?

Regards,
Aiya
0
Comment
Question by:aiya
7 Comments
 
LVL 15

Expert Comment

by:Timbo87
ID: 9855548
I set up a test and it looks like the popup window is relative to the parent window that opened it. Therefore a child window popped up from a parent cannot be modified by another non-parent window.
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9855660
If the 2 parent windows are in a frame set then they can both communicate with the popup cretad by one of the windows, is this wht you want.? If the windows are entirely different browser windows then it can not be done unless I believe if you use activeX.

If you have 2 frames named frame1 and frame2 and in frame1 the commoand

win=window.open(''"","","")

then from frame2 you can write to the popoup for instance with

parent.frame1.win.document.write("hi this is from frame 2 ")
0
 
LVL 15

Expert Comment

by:Timbo87
ID: 9855673
Gwyn's solution works if they're in the same frameset. For my test I assumed they were two completely different browser windows.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9855864
This is not going to happen with different browser instances (unless you write some compex activex stuff) but if the parent windows are going to be in the same browser instance it is possible using a hidden frame. I am not sure what you are looking for.
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9855898
ie if say a.htm opens a popup and has a link to b.htm or c.htm then it is possible for b.htm or c.htm to communicate with the popup. Is this what you want ?
0
 

Author Comment

by:aiya
ID: 9856335
okie, the current sounds more like my case... Actually, I have a list of htm that will link to this child window, so watever hyperlinks that I click in the parent window, i want the parent window information to be passed into the child window. How can I go about doing? Can u give me an example? Thanks alot!!! =)
0
 
LVL 10

Accepted Solution

by:
NetGroove earned 0 total points
ID: 9856338
Here my answer: it is possible.

To take Gwin's mnemonic, if you have parents a.htm, b.htm, c.htm,  and one of the opens a popup p.htm, then can every of the parents get access to the popup like this:

a.htm opens the popup:

   window.open('p.htm','popname',height=100,width=100');


The others two, and also the a.htm, can regain the access to popup like this:

   pw = window.open('','popname');
   
The common factor is the window name assigned to the popup.

By the way, in the same manner can also the popup comunicate to any of the parents.
Before the popup can access any of them parent needs the apropriate parent to have a window name.
Window name is a global attribute and can be set like this:

window.name = "Parent1";

So the popup can acces parent one like this:
  p1 = window.open('', "Parent1");

Now can the popup resuse all the object from "Parent1", like form fields, functions, global vars, and so on.




0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now