Window.Opener equivalent
-
Hi All, I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false. basically, i want it so that when used as a popup: column1 = visible false column2 = visible true column3 = visible false when linked in the main window: column1 = visible true column2 = visible false column3 = visible true (the exact opposite) I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code. Any help would be appreciated
-
Hi All, I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false. basically, i want it so that when used as a popup: column1 = visible false column2 = visible true column3 = visible false when linked in the main window: column1 = visible true column2 = visible false column3 = visible true (the exact opposite) I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code. Any help would be appreciated
Craigpt wrote:
i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code.
You can't. The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know. If you put a value in the querystring that reflects how the page is used, the server can check that value.
--- single minded; short sighted; long gone;
-
Hi All, I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false. basically, i want it so that when used as a popup: column1 = visible false column2 = visible true column3 = visible false when linked in the main window: column1 = visible true column2 = visible false column3 = visible true (the exact opposite) I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code. Any help would be appreciated
-
Craigpt wrote:
i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code.
You can't. The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know. If you put a value in the querystring that reflects how the page is used, the server can check that value.
--- single minded; short sighted; long gone;
Guffa wrote:
The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know.
Ok thanks, that's what i needed to know. I remembered the popup window already had querystrings in the URL so i just used the presence of those to decide.
-