473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Howto: Child window make parent window into focus?


Folks,

I'm working on a contact name/address database whereby a slimed down list is
shown in the main window. When a record is selected, the complete record is
displayed in a new window via a call to window.open

As opposed to closing and re-opening new windows, I would prefer that when
the user is finished reading the complete record, they can click a link
whereby the main window is sent in to focus.

Thus, a main (or parent) window opens a new window and the new window comes
in to focus. I *do not* want to close the new (child?) window, instead, I
want the parent window to come in to focus... Since the child is in focus,
how can I call a routine that will place the parent in to focus?

All help, via the newsgroup, is much appreciated,
thanks,
randelld
Jul 20 '05 #1
9 48880
<p><a href="javascript:window.opener.focus()" target="_self">Set Focus
To Opener Window</a></p>

Randell D. wrote:
Folks,

I'm working on a contact name/address database whereby a slimed down list is
shown in the main window. When a record is selected, the complete record is
displayed in a new window via a call to window.open

As opposed to closing and re-opening new windows, I would prefer that when
the user is finished reading the complete record, they can click a link
whereby the main window is sent in to focus.

Thus, a main (or parent) window opens a new window and the new window comes
in to focus. I *do not* want to close the new (child?) window, instead, I
want the parent window to come in to focus... Since the child is in focus,
how can I call a routine that will place the parent in to focus?

All help, via the newsgroup, is much appreciated,
thanks,
randelld


Jul 20 '05 #2
Mike Scirocco <ms***@hotmail.com> writes:
<p><a href="javascript:window.opener.focus()" target="_self">Set Focus
To Opener Window</a></p>


Don't use javascript:-URIs. <URL:http://jibbering.com/faq/#FAQ4_24>
The "target" attribute does nothing, and can safely be omitted.
I.e.,
<p><a href="WhyYouNeedJSToUseThisPage.html"
onclick="opener.focus()">Set Focus To Opener Window</a></p>

However, the appropriate control to use for effects like this is a
button. Links link to other pages. Buttons have effects. In this case,
you want something to click to get an effect.

<p><input type="button" value="Set Focus To Opener Window"
onclick="opener.focus()"></p>
Please trim your quotes and preferably answer below the quoted content.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
Thanks.

Lasse Reichstein Nielsen wrote:
Mike Scirocco <ms***@hotmail.com> writes:
<p><a href="javascript:window.opener.focus()" target="_self">Set Focus
To Opener Window</a></p>


Don't use javascript:-URIs. <URL:http://jibbering.com/faq/#FAQ4_24>
The "target" attribute does nothing, and can safely be omitted.
I.e.,
<p><a href="WhyYouNeedJSToUseThisPage.html"
onclick="opener.focus()">Set Focus To Opener Window</a></p>

However, the appropriate control to use for effects like this is a
button. Links link to other pages. Buttons have effects. In this case,
you want something to click to get an effect.

<p><input type="button" value="Set Focus To Opener Window"
onclick="opener.focus()"></p>
Please trim your quotes and preferably answer below the quoted content.
/L


Jul 20 '05 #4

"Randell D." <yo**************************@yahoo.com> wrote in message
news:sRGpb.285679$6C4.186378@pd7tw1no...

Folks,

I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a call to window.open

As opposed to closing and re-opening new windows, I would prefer that when
the user is finished reading the complete record, they can click a link
whereby the main window is sent in to focus.

Thus, a main (or parent) window opens a new window and the new window comes in to focus. I *do not* want to close the new (child?) window, instead, I
want the parent window to come in to focus... Since the child is in focus,
how can I call a routine that will place the parent in to focus?

All help, via the newsgroup, is much appreciated,
thanks,
randelld


Thanks...
Jul 20 '05 #5
DU
Lasse Reichstein Nielsen wrote:
Mike Scirocco <ms***@hotmail.com> writes:

<p><a href="javascript:window.opener.focus()" target="_self">Set Focus
To Opener Window</a></p>

Don't use javascript:-URIs. <URL:http://jibbering.com/faq/#FAQ4_24>
The "target" attribute does nothing, and can safely be omitted.
I.e.,
<p><a href="WhyYouNeedJSToUseThisPage.html"
onclick="opener.focus()">Set Focus To Opener Window</a></p>

However, the appropriate control to use for effects like this is a
button. Links link to other pages. Buttons have effects. In this case,
you want something to click to get an effect.

<p><input type="button" value="Set Focus To Opener Window"
onclick="opener.focus()"></p>
Please trim your quotes and preferably answer below the quoted content.
/L


Your reply, excellent as usual, explains (indirectly) why child windows
should not be maximized and why browser manufacturers never implemented
the code to enlarge child windows by force.
The code given is unneeded unless the child window is maximized. When
the user knows that clicking a link will create a secondary window or
when the user can easily see, notice that a new secondary window has
been created, then he does not need any code to give focus back to the
opener.
Maximizing a child windows or creating a very large and long child
window creates an usability problem, an usability burden that the given
code tries to compensate.

DU

Jul 20 '05 #6

"DU" <dr*******@hot-R-E-M-O-V-E-mail.com> wrote in message
news:bo**********@news.eusc.inter.net...
Lasse Reichstein Nielsen wrote:
Mike Scirocco <ms***@hotmail.com> writes:

<p><a href="javascript:window.opener.focus()" target="_self">Set Focus
To Opener Window</a></p>

Don't use javascript:-URIs. <URL:http://jibbering.com/faq/#FAQ4_24>
The "target" attribute does nothing, and can safely be omitted.
I.e.,
<p><a href="WhyYouNeedJSToUseThisPage.html"
onclick="opener.focus()">Set Focus To Opener Window</a></p>

However, the appropriate control to use for effects like this is a
button. Links link to other pages. Buttons have effects. In this case,
you want something to click to get an effect.

<p><input type="button" value="Set Focus To Opener Window"
onclick="opener.focus()"></p>
Please trim your quotes and preferably answer below the quoted content.
/L


Your reply, excellent as usual, explains (indirectly) why child windows
should not be maximized and why browser manufacturers never implemented
the code to enlarge child windows by force.
The code given is unneeded unless the child window is maximized. When
the user knows that clicking a link will create a secondary window or
when the user can easily see, notice that a new secondary window has
been created, then he does not need any code to give focus back to the
opener.
Maximizing a child windows or creating a very large and long child
window creates an usability problem, an usability burden that the given
code tries to compensate.

DU


Fair comment 'DU' if the web page was a normal website but I am developing
an intranet application - I want to reduce I/O (both client and server side)
so my idea is this:

1 Main window lists a basic list of names/addresses with links to a popup
window
2 When user clicks on one of the links, the full record is written to the
popup window and brought into focus.
3 When user is finished reading the record, they click on a link to return
the main window to focus.

This reduces I/O since the basic list of names/addresses do not need to be
retrieved everytime a single record is display (which would be the case if
everything was in a single window). The reason why I want a link on the
child window to bring the parent in to focus is I don't want a popup to be
opening/closing repeatedly - I prefer bringing one in and out of focus
instead.
Jul 20 '05 #7
"Peeky" <em**********************@s.it.helps.everybody.com > wrote in
message news:4Agqb.313352$9l5.140463@pd7tw2no...
<snip>
This reduces I/O since the basic list of names/addresses do not
need to be retrieved everytime a single record is display (which
would be the case if everything was in a single window). ...

<snip>

Navigating a one-window interface back to the names/addresses list does
not impose the need to re-retrieve that date from a database.
Server-side session objects could be used to store the pertinent
information from an initial database look-up and (quickly) re-display
that information when needed. And that is particularly viable on an
Intranet application because the number of simultaneous sessions would
be relatively low and predictable. The session object is also in a good
position to know/find out when user interaction has resulted in changes
in the database and therefor when it would be necessary to re-retrieve
the information from the database.

Richard.
Jul 20 '05 #8
Pls specify for what kind of application u are seeking soluton vb.net,
asp.net, asp, javascript, jscript.net.....

Keyur Shah
Verizon Communications
732-423-0745

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #9
How would one do the opposite? That is by clicking the same link in the main window bring the child window into focus - as when browsing, if they try to return to the child via the main window, if it is already loaded it will not reaappear and this can confuse people into thinking it is not working, when it is just minimized.

Thanks


Myshkin
Jun 20 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Filiz Duman | last post by:
Hi, I am opening a pop up window (child) from a parent window. The Child window does show a table with multiple columns and rows, each showing a value, e.g. 9 or 10 or etc. I have the values as...
3
by: Sandfordc | last post by:
I was curious one day and started to explore the whole idea of a document opening a pop up and that pop up being able to send data, that was input by the user, back to the parent. Does anyone have...
3
by: RobG | last post by:
In Firefox if an HTML page is not hosted inside a frame or iframe, the following return true: (window === window.self); (window === window.parent); But in IE they return false (using ==...
4
by: Richard Lewis Haggard | last post by:
What is the mechanism by which a child window can notify its parent that it has been clicked on? -- Richard Lewis Haggard www.Haggard-And-Associates.com
2
by: gsuns82 | last post by:
hi all, I got to reload parent window from its child window,i used the folloeing code opener.location.reload(); self.close(); in child window. Parent window gets...
1
by: pingalkar | last post by:
Hi, In my application, I call one popup winodow by using this link.. <a href="#" onClick="return showWindow('1','XYZ');"> <img src="images/magnifier.gif" ALT="Chemicals"...
3
by: Natygan | last post by:
Hi, I've got a Web page which can become a parent window : some links use "window.open" to open the desired link into a new child window. This parent window has got an auto-refresh...
1
by: varunvashishth | last post by:
hi, I'm facing a problem with displaying a child jsp on top of parent jsp. on clicking a link in parent jsp the child jsp opens up and it has some list of values and other textboxes which gets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.