Solved

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

Posted on 2008-10-30
10
758 Views
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.

Code:

document.forms[0].submit();
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
0
Comment
Question by:sunnysaran
  • 4
  • 3
  • 2
10 Comments
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 250 total points
ID: 22848534
window.open(HOOK_URL,'nameOfFrame')

Michel
0
 
LVL 63

Accepted Solution

by:
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;



0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22849660
not if the opener is gone, then you can only use window.open with nameOfWindowOrFrameor a link with target=nameOfWindowOrFrame
0
 
LVL 63

Expert Comment

by:Zvonko
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:
<script>tf=window.open(HOOK_URL,'nameOfFrame');tf.location.reload(true);self.close()</script>
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:sunnysaran
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.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 22871611
Show your frameset structure please.
0
 

Author Comment

by:sunnysaran
ID: 22872934
Guys-

Finally it works. The concept was nested frames.


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

Expert Comment

by:Zvonko
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:
window.open(HOOK_URL,'IACFrame')

Open in new window

0
 
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.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now