Updating Documents via the Web

I am in the process of designing a system to record meeitng minutes.

In the top portion of the frame, the user can search the database for minutes by Date, Topic, or Keyword. Here, specified users may also add new minutes.

In the bottom frameset, I have an agent - QueryData - that displays the results of the search.

I have two questions.

When the user selects the Add Minutes button from the top frame, a window opens allowing the user to enter the date, topic, region and description. When the user presses the save button (@Command([FileSave])), I would like the agent in the bottom of the frameset to refresh.

I have the following code in the agent:

Print |<html>|

Print |<script language=javascript>|

Print |function openWin(url)|

Print|{|

Print |window.open(url,"myWin","width=800,height=450,top=0,left=0,location=no,toolbar=no,title=no,resizable=yes")|

Print |}|

Print |function refreshData()|

Print  |{|

Print |setTimeout('window.location.reload()',1000);|

Print |}|

Print "</script>"

This code doesn’t work - perhaps because it is in the agent??

I know it is possible to refresh the underlying agent, I have seen it in action and used it once before, but I have been unable to get anything working in this application.

My next question is concerns deleting documents. The window that allows the user to add a new item also contains a delete button (if ( confirm(‘Delete this document?’) ) window.location.search = ‘?DeleteDocument’;). When clicked, the window moves to a generic page setup by our company indicating that the username or password is not correct.

When I return and refresh the agent manually, the document is deleted. How can I get a the document to delete and the agent to refresh automatically, similar to the add new minutes item?

Any ideas or suggestion would be greatly appreciated. Thanks in advance.

Subject: Updating Documents via the Web

You should be able to use a $$ReturnDocumentDeleted page/form to handle the current ugly deletion return, and code something like:

try {

window.opener.top.framename.location.reload();

}

catch(e) {

//alert(e.message);

}

should do for the refresh if it appears on your $$ReturnDocumentDeleted and Thank-you pages. (You can uncomment the catch for debugging. If the catch is left commented, it allows the code to fail without bothering the user, so if you launch the same form/page in a different context, it won’t cause problems.)

Subject: RE: Updating Documents via the Web

Hey Stan, I created the $$ReturnDocumentDeleted form, which contains a MessageString field and a Close hotspot button.

When I click the delete button, my $$ReturnDocumentDeleted form appears. When I click close, I still get that customized 'Your Username and password is incorrect" company message. When I click X and right click to refresh the agent, the document has been deleted, but the problem is that the refresh is appearing to work.

My code for the hotspot button is:

form.submit();

and onSubmit I have the code you suggested:

try {

window.opener.top.Body.location.reload();

}

catch(e) {

alert(e.message);

}

Is this in the wrong place?? Thanks for the help - I’ll keep at it!

Subject: RE: Updating Documents via the Web

I would move the call to the refresh code to the onload event of the $$ReturnDocumentDeleted form and simplify the close button to window.close(). That should get rid of the authentication nasties – it sounds like the “company setting” is trying to send people to something they don’t have access to. They’re not likely to fix their end, so you’ve got to work to avoid it ;o) (We all have admins in our lives…)

Subject: RE: Updating Documents via the Web

Stan,

I have implemented your suggestion and received the following error:

‘window.opener.top.Body.location’ is null or not an object.

I think it has to do with the fact that I have a frameset within a frameset. I am reviewing the window object properties now to find a solution.

Our intranet has three frames: top, left and body.

In the body frame, I have another frameset containing two frames: search and body.

Perhaps the fact that both framesets have a frame named body is the problem.

Subject: RE: Updating Documents via the Web

Well, suppose that the child frameset lives in the “Body” frame of the top frameset. The address then becomes:

window.opener.top.frames[‘Body’].document.frames[‘Body’].location

(Have I mentioned that I am a violent anti-frameset radical?)

Subject: RE: Updating Documents via the Web

Thanks Stan - I am going to give it a try!