Howto: Child window make parent window into focus?

Discussion in 'Javascript' started by Randell D., Nov 4, 2003.

  1. Randell D.

    Randell D. Guest

    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
     
    Randell D., Nov 4, 2003
    #1
    1. Advertising

  2. <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
    >
    >
    >
    >
     
    Mike Scirocco, Nov 4, 2003
    #2
    1. Advertising

  3. Mike Scirocco <> 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 -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Nov 4, 2003
    #3
  4. Thanks.

    Lasse Reichstein Nielsen wrote:

    >Mike Scirocco <> 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
    >
    >
     
    Mike Scirocco, Nov 4, 2003
    #4
  5. Randell D.

    Randell D. Guest

    "Randell D." <> 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...
     
    Randell D., Nov 4, 2003
    #5
  6. Randell D.

    DU Guest

    Lasse Reichstein Nielsen wrote:

    > Mike Scirocco <> 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
     
    DU, Nov 5, 2003
    #6
  7. Randell D.

    Peeky Guest

    "DU" <> wrote in message
    news:bo9tj7$gf9$...
    > Lasse Reichstein Nielsen wrote:
    >
    > > Mike Scirocco <> 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.
     
    Peeky, Nov 6, 2003
    #7
  8. "Peeky" <> 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.
     
    Richard Cornford, Nov 6, 2003
    #8
  9. Randell D.

    keyur shah Guest

    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!
     
    keyur shah, Nov 6, 2003
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bvidinli
    Replies:
    0
    Views:
    290
    bvidinli
    Apr 15, 2008
  2. Noel Dolan
    Replies:
    0
    Views:
    249
    Noel Dolan
    Jul 18, 2004
  3. Spammay Blockay
    Replies:
    1
    Views:
    509
    Dietmar Meier
    Feb 4, 2005
  4. Roger
    Replies:
    3
    Views:
    345
  5. Bitswapper
    Replies:
    5
    Views:
    162
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page