Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 803
  • Last Modified:

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

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
sunnysaran
Asked:
sunnysaran
  • 4
  • 3
  • 2
2 Solutions
 
Michel PlungjanIT ExpertCommented:
window.open(HOOK_URL,'nameOfFrame')

Michel
0
 
ZvonkoSystems architectCommented:
Or like this:

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

Or this:

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



0
 
Michel PlungjanIT ExpertCommented:
not if the opener is gone, then you can only use window.open with nameOfWindowOrFrameor a link with target=nameOfWindowOrFrame
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ZvonkoSystems architectCommented:
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
 
sunnysaranAuthor Commented:
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
 
ZvonkoSystems architectCommented:
Show your frameset structure please.
0
 
sunnysaranAuthor Commented:
Guys-

Finally it works. The concept was nested frames.


window.opener.parent.frames("APPLICATION").frames("IACFrame").location.href = HOOK_URL
0
 
ZvonkoSystems architectCommented:
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
 
Michel PlungjanIT ExpertCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now