Document Context Question

I’m adding a web front end to a Notes database. The database has a form action that runs an agent. The agent calls a Script Library as follows:

Set doc = session.DocumentContext

Call TestScriptLibrary(doc)

There’s a problem in that after the Script Library is called by the agent, the frame that displays the document turns white. I’ve verified through Print statements that after the Script Library runs, control is properly passed back to the agent.

To continue displaying the document while the Script Library runs, I tried adding an ‘HTTP_Referer’ computed field to the form. The Script Library refers to this field as follows:

Dim arg As String

arg = doc.HTTP_Referer(0)

Print “”

Neither this code nor several variations I’ve tried display the document while the Script Library runs. However, I’ve found that a web page is displayed if a hard-coded URL is used - for example: Print “window.top.document.frames(1).location.href = ‘http://w3.ibm.com’”

I’d appreciate any suggestions on how the Print statement might be modified to display the document on the web while the Script Library runs, or whether there’s a better solution that provides the same result.

I’d also welcome any ideas on whether the use of Script Libraries should be avoided on the Web because of navigation issues such as that described here?

Thanks.

Subject: Document Context Question

It’s nothing to do with the script library. Print statements on the web don’t like to stop and start like that. Call it a personality disorder. If you assemble the string on one line and print it on another, it will work.

Subject: RE: Document Context Question

Would you have any suggestions on how the syntax might be changed in the Print statement so that the document is displayed? I’ve tried the following Print statements in addition to others, but the frame is displayed as all white, or a Javascript error indicates that a semicolon is missing:

Print “location.href=‘+arg+’;”

Print “location.href=”+arg+“;”

Print “location.href=”+arg;

Print “window.top.document.frames(1).location.href = ‘+arg’”

Print “window.top.document.frames(1).location.href = '+arg”

Print “window.top.document.frames(1).location.href = +arg”

Print “window.top.document.frames(1).location.href = ‘|& arg & |’”

Print “window.top.document.frames(1).location.href = ‘|& arg & |’;”

Print “window.top.document.frames(1).location.href =”+arg

Print “window.top.document.frames(1).location.href =”+arg;

Print “window.top.document.frames(1).location.href =”+arg+“;”

Thanks.

Subject: RE: Document Context Question

string = “Constant part of the statement” + arg + "some more"Print string