How to set Window.Opener to set a specific frame in a window

Posted on 2008-10-30
Last Modified: 2012-05-05
Hello Experts-

My problem I believe is very specific Javascript, DHTML.
Our System: ASP, Javascript and HTML
Client's System: SAP OCI (SRM)

Project:  I work for a printing company and I am trying to integrate our online ordering system with one of customers SAP system using SAP OCI process.  Our customer's employees visit the SAP system of the client and click on a link to be redirected to our website. Once in our website, the user completes the order and checks out of our system. When a user checks out of our system, he will be automatically redirected to the client's website and the shopping cart will be updated on our customer's end.

What is passed between the two websites: Our client's system passes a HookURL each time a user comes in and during the check out process we setup the Window.Opener to the HOOKURL so the shopping cart is automatically updated.


window.opener.location.href = HOOK_URL;

Challenge:  Everything works, but one SMALL issue. Once my window passes the reference to the Window.Opener, it does not point to the right frame.  It refreshes the whole Window instead of the actual frame that has opened this pop up.

Can someone help
Question by:sunnysaran
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 250 total points
ID: 22848534,'nameOfFrame')

LVL 63

Accepted Solution

Zvonko earned 250 total points
ID: 22849423
Or like this:

window.opener.frames['nameOfTheFrame'].location.href = HOOK_URL;

Or this:

window.opener.frames.nameOfTheFrame.location.href = HOOK_URL;

LVL 75

Expert Comment

by:Michel Plungjan
ID: 22849660
not if the opener is gone, then you can only use with nameOfWindowOrFrameor a link with target=nameOfWindowOrFrame
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 63

Expert Comment

ID: 22865888
Also it is to early immediately after theForm.submit() on client side to refresh the target frame.
Better would be to place in the server side submit response page the script for the target frame refresh.
So put the statement proposed by Michel in the server submit response page like this:

Author Comment

ID: 22871391
Zvonko, MIchael and mplugjan- Thank you folks for helping out.

I think Zvonko's recommendation is close. I made some progress from last week. I used the statement below to fix this.

window.opener.parent.frames("APPLICATION").location.href = HOOK_URL

And now it does refreshes, the page, but I have two new problems.

a. The parent Frameset has 3 frames. The left menu disappears, but the top header is still in tact. (This is the actual progress, because the top header is still displayed).

b. Second problem is the APPLICATION frame is now not scrolling.

Any comments on how to fix this? I would appreciate some help.
LVL 63

Expert Comment

ID: 22871611
Show your frameset structure please.

Author Comment

ID: 22872934

Finally it works. The concept was nested frames.

window.opener.parent.frames("APPLICATION").frames("IACFrame").location.href = HOOK_URL
LVL 63

Expert Comment

ID: 22873634
Nested or not nested, the solution proposed by Michel has to work for you. So the assumption is that you did not type it correctly:,'IACFrame')

Open in new window

LVL 75

Expert Comment

by:Michel Plungjan
ID: 35763004
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question