This might be a very newbieish question but here it goes.
I have a control that "pops out" when the user clicks a link.
The control is a <div> element with some stuff in it that is asynchronously updated every few seconds. The user can click an image in the top left corner of the <div> to "pop-out" the control.
The pop-out action is pretty simple: I call the window.open() method to open the control in a new window. After calling the window.open() method, the control in the parent window sends a request to the server sets some server-side variables that indicates that the control is in a "popped out state", the server then hides the <div> element and displays a hyperlink that allows the user to re-display the control again (in case something weird happens when the user closes the popped-out window).
When the user clicks the hyperlink that allows the user to re-display the control in the main window, I want to ensure that the pop-out window (child) is closed. I want to ensure that only one of these controls are active at a time per browser.
Normally I would save a reference to the child window in the main window when the window.open() method is called...that way I could use this reference in order to close the child window.
But, the problem is that the page posts back to the server to set the server-side variables when the user clicks the button to open the child window. Even if I used Ajax to asynchronously post back to the server, other controls on the page cause full page requests to the server that require it in order to work (changing languages etc).
How do I save a reference to the child window that will persist across page requests?
If that is not possible, then how do I close the child window??
Thanks for your help.
-Frinny
I have a control that "pops out" when the user clicks a link.
The control is a <div> element with some stuff in it that is asynchronously updated every few seconds. The user can click an image in the top left corner of the <div> to "pop-out" the control.
The pop-out action is pretty simple: I call the window.open() method to open the control in a new window. After calling the window.open() method, the control in the parent window sends a request to the server sets some server-side variables that indicates that the control is in a "popped out state", the server then hides the <div> element and displays a hyperlink that allows the user to re-display the control again (in case something weird happens when the user closes the popped-out window).
When the user clicks the hyperlink that allows the user to re-display the control in the main window, I want to ensure that the pop-out window (child) is closed. I want to ensure that only one of these controls are active at a time per browser.
Normally I would save a reference to the child window in the main window when the window.open() method is called...that way I could use this reference in order to close the child window.
But, the problem is that the page posts back to the server to set the server-side variables when the user clicks the button to open the child window. Even if I used Ajax to asynchronously post back to the server, other controls on the page cause full page requests to the server that require it in order to work (changing languages etc).
How do I save a reference to the child window that will persist across page requests?
If that is not possible, then how do I close the child window??
Thanks for your help.
-Frinny
Comment