Appending text to a richtext on web

Hi all,

there is an agent ,when runs on client ,it works fine to append text to a richtext field,but when it runs on web the text is not appended to the richtext …

i have used document context, so dont reply me regarding uidocument…

my part of code—>

Dim ritem1 As NotesRichTextItem '(doc1,“UsageLinks”)

	Set ritem1 = doc1.GetFirstItem("UsageLinks")

	

	

	

	Call ritem1.AddNewline(1)

	

	

	

	

	Call ritem1.AppendText("test")

call doc1.save(true,true)

Regards

Rupesh

Subject: Appending text to a richtext on web…

Are you running this from an agent called directly or from a WebQueryOpen or WebQueryClose agent, or how? You need to make sure that the code is running at all, and where it is failing. You can do that with MessageBox statements (on the web, they will go in the log).

Subject: RE: Appending text to a richtext on web…

i am calling this agent on button click…and how can i see the log of agent for the web…

Subject: RE: Appending text to a richtext on web…

If you call an agent on button click (no matter how), document context does not refer to the document that happens to be rendered as HTML to the user’s browser. All you get is a “virtual” document, that gives you access to CGI variables.

Subject: RE: Appending text to a richtext on web…

i have already checked the Render pass through HTML property and generate HTML for all fields in the formso …what can be the problem…Actually i don’t have much idea about web application,so facing problem…

waiting for reply…

Regards…

Subject: Double posting, please ignore

Subject: RE: Appending text to a richtext on web…

Taking into account your last sentence:

If you call an agent from a button click, then

Dim session As New NotesSession

Dim doc1 As NotesDocument

Set doc1 = session.DocumentContext

has nothing to do with the document that is displayed in the browser. You can add or modify field values as you like, but it’s just not the document you intend to modify.

Change your button code to simply save the document. A simple formula

@Command([FileSave])

will do just , if you kept the database property to use JavaScript when generating pages enabled. Make your agent run on event agent list selection, target none, and add its name in the forms WebQuerySave event. Do NOT call the Save() method explicitely.

Now every time you click that button, all changes to the editable fields will be submitted, the agent will run and modify the document and the document will be reloaded.