Open document to second tab

I have a form (Status) with a tabbed table on it. On the second tab is a dynamic table (you know, where you have the add, modify, and delete buttons to append rows to hidden multi-value fields, then use Lotusscript to build a table in a richtext field based on those hidden fields, then you close and reopen the document).

Well, after adding, modifying, or deleting a row, the document reopens to the first tab – naturally. Is there a way to re-open the doc to the second tab?

I envision something where, I can grab the table and issue a “click” event on the tab or something like that. Solution would have to work in both read and edit mode.

Thanks for your help.

-Jeff

Subject: SOLUTION: Open document to second tab

I didn’t say, but I wanted to do this in the Client, so those web posts suggested didn’t help me.

Unfortunately, I cannot get links and anchors working right, as in number 6 in this http://tinyurl.com/2g53y2 post, because of some wierd problem with EditDocument’s newInstance parm, http://tinyurl.com/25g49p. This is too bad since the anchors would let you scroll down the page, whereas this solution only lets you open to the right tab.

My solution is to use programmable tables and a separate field for tracking which tab to open.

First, you need an editable field named $. It must be editable, other types don’t seem to work.

But you can’t just value that field with the tab to reopen because if you use one of the buttons which reopens the document, then click Save, you get the Save warning. I don’t know why.

So you have to use another item – you don’t need a field – named OpenTab and use it to value $ in Queryopen.

Using OpenTab also allows you to reset the table to the first tab for the future.

Herewith, my solution:

$: Editable, hidden field

Sub Querysave

'If the user is saving the doc through the UI, reopen to first tab

Call Source.Document.ReplaceItemValue(“OpenTab”, “ProjectInfo”)

End Sub

Sub refreshDoc(doc As NotesDocument, uidoc As NotesUIDocument, dept As String)

'OpenTab is the tab to reopen to.

Call doc.ReplaceItemValue("OpenTab", dept)

Call doc.Save(True,True)

Call uidoc.FieldSetText("SaveOptions","0")

Call uidoc.Close()

Call ws.EditDocument(True, doc)

End Sub

Sub Queryopen

If thisdoc.OpenTab(0) = "ProjectInfo" Then

	Call thisdoc.ReplaceItemValue("$ProjectTable", "ProjectInfo")

Else

	Call thisdoc.ReplaceItemValue("$ProjectTable", "TeamInfo")

	'Reset OpenTab in case user closes without saving to reopen to first tab.

	Call thisdoc.ReplaceItemValue("OpenTab", "ProjectInfo")

	Call thisdoc.Save(True, True)

End If

End Sub

Now, all I need to do is learn to scroll the document in Lotusscript. There are no editable fields on the page, so I can’t use NotesUIDocument.GotoField.

Subject: Open document to second tab

I search for open and tab

Date

Topic

08/25/2003

2

Opening a specific tab on the web (Margit Kiewit)

RE: Opening a specific tab on the web  (Joris De Geyndt 08/25/2003)









	RE: Opening a specific tab on the web  (Margit Kiewit 08/26/2003)