Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie question - communicate between browser windows

Status
Not open for further replies.

ChadBryant

Programmer
Oct 29, 2004
11
US
I'm not sure if what i'm trying to do is possible, but I found this forum and hopefully someone can tell me. Many thanks in advance...

I am developing an ASP.NET web app, but what I need to do needs to happen on the client side without any posting back to the server.

I'm not sure how to ask my question or how to word it without giving some brief detail of the application...

I want to have a tree view type control (like Windows Explorer) where the user will select a module from the top level nodes and drill down. The next level will be one of their user created analyses and then they can drill down to the next level which will contain the reports they've created under these analyses. When they click on a report, a new window will open up showing the report. The requirements of this application dictate that the report will have it's characteristics (date range, etc) set at the analysis level, so many reports under an analysis will have the same characteristics.

So the tree will be like:

Module 1
Analysis 1
Report 1
Report 2
Report 3
Analysis 2
Report 1
Report 2
Module 2

etc....

So they will drill down in the tree under Module 1, Analysis 1 (for example) and click on Report 1. This will open up a new Window where Report 1 will be displayed. The user may see Report 1 and decide to change the date range or any other characteristic but that will mean they will have to close the report view window, return to the explorer (main) window and go up a node and click on Analysis which will open up in a right side frame the characteristics for that analysis.

It would be nice for this to be automated so the report view popup window could have a link to edit the analysis. This would close (or preferrably not close but just bring the first window to focus in front of the popup report viewer window). It would have to also select the proper node in the tree and bring up the form on the right.

I don't know if there is a way to have a custom event like a listener on the main explorer form and the popup form can fire the event and then bring the other window to back to focus with the event handler in the main form selecting the analysis and then displaying the edit analysis page in the ride hand frame. The popup window would only do two things 1) fire the event (ie OnEditAnalysisRequest) and 2) bring the main window back to focus (or close it...not sure which I really prefer). The main window would respond to the event and do the job of selecting the analysis in the tree and then displaying the edit page in the right frameset.

Thanks. please let me know if this is possible!

 
easy when you have a parent/child relationship between the windows, i.e. one window (tree view) opened the other (report)

have your tree view keep a handle to the report window, like

var rptWin = window.open("myreport.html");

and you can access objects/properties a la

rptWin.document.forms["someForm"].someField.value = "someVal";

the report window can access its parent a.k.a. opener through its "opener" object:

opener.document.forms["treeForm"].foo.value = "bar";

hope this helps

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Cool, I think the opener is how I need to handle this. I'll try that and see how it goes. I've never heard of opener before. Recommend any good Javascripts sites, books, other resources?

Thanks
 
for windows opened by script, "opener" is the object that refers to the window containing the script that called to open the window.

book: o'reilly "javascript: the definitive guide"

site:
devguru


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top