Agent, iFrame, Window, Javascript, Help

I have a web application that displays a view using HTML. Several fields in this HTML view are wrapped in input tags so the user can update the values from the view. A javascript onchange event calls an agent to save the backend document. This works great. When the agent runs, I direct the output to a separate iframe on the page to prevent the agent output from displaying on the page and replacing the view.

If the user is away from the app and the session times out however, I’m running into problems. The view remains on the screen, but the iframe with the agent output displays the login screen. What I’m trying to do is refresh the parent window if the agent fails. That will bring the login screen up for the user so they know they are logged out and need to log back in. I’m having trouble forcing that parent window to refresh. Here’s the part of my agent that has the javascript to refresh the parent window (or the redirect it to a different url). I can’t get it to refresh the parent however. All it does is refresh the iframe contents. Can anyone help?

The commented out lines are things I’ve tried that have not worked.

Print |Script Language=JavaScript>|

‘Print |parent.location.replace(’/Store/WebBakeAdj.nsf/$$ViewTemplateDefault?OpenForm’)|

‘Print |parent.location.href=’/Store/WebBakeAdj.nsf/$$ViewTemplateDefault?OpenForm’|

'Print |parent.location.reload()|

Print |parent.opener.location.reload()|

Print ||

I’m not very good at javascript yet so it could be something simple. Any pointers on getting this to work, or pointers on how to troubleshoot it are much appreciated.

btw I’m using IE 6. Thanks.

Subject: Agent, iFrame, Window, Javascript, Help

You are close, but not quite there.

The ‘parent.opener’ is what you use when you have opened a new window - a pop-up dialog. You are now having that here do you? You just want your script to update another frame - right?

You must reference the correct frame, that’s all.

If your frames have names, you can use that:

parent.frames[“framename”].location.reload();

If they don’t have names, you can still access them via their ordinal number:

parent.frames[0].location.reload();

Just google for Javascript and frames for some examples.

You don’t need to use ‘parent’. If this is a basic frameset with a 3-pane layout, you can exchange ‘parent’ with ‘top’.

Btw, in you commented code you are using URLs where you try to open $$ViewTemplate forms. Why?

If you want to open a view you should use the ?OpenView command. The view will automatically open in the $$ViewTemplate assiciated with the view.

Subject: RE: Agent, iFrame, Window, Javascript, Help

Thanks for the response. I’m not using a frameset. This is all on the $$ViewTemplateDefault form. My view is embedded on that form, and that’s where the updates are taking place. The only frame is the embedded iframe that displays the agent output. It seems like this should be really simple, but I’m just not getting anything to work!

Thanks

Subject: Agent, iFrame, Window, Javascript, Help

Print |Script Language=JavaScript>|

Don;t u need a < at the beginning ?? or was that a typo in the post