我有一个嵌入式视图,在单击视图中的文档时会打开一个对话框。 关闭对话框时(使用保存和关闭或只关闭按钮使用基本的@Commands),而不是刚关闭它的对话框清除屏幕上的底层表单并打开对话框,就像它是一个表单一样。 如果我关闭它,原始的底层形式会重新出现,这就是我想要发生的,而不会出现插入对话框的形式。
这是因为我使用@Function调用@Command([FileSave]); @Command([FileCloseWindow])
还是还有其他我错过的东西?表单上是否有我没有设置的标志,或者对话框上的操作是否需要用LotusScript编写,他们必须以某种方式调用表单?
使用以下公式从视图中打开对话框:
Sub Queryopendocument(Source As Notesuiview, Continue As Variant)
Call OpenDocInDialogBox( Source, True, 1, "frmOrganization", "Organization")
End Sub
而OpenDocInDialogBox函数是:
Function OpenDocInDialogBox( Source As NotesUIView, Continue As Variant, WhatIfNonEmbed As Integer, Form_Name As String, Dlg_Title As string) As Integer
Dim DocColl As NotesDocumentCollection
Dim Doc As NotesDocument
Dim flag As Integer
Dim ws As New NotesUIWorkspace
Dim temp As Variant
Continue = False
flag = False
Set DocColl = Source.Documents
Set Doc = DocColl.GetFirstDocument
doc.IsDialogBox = "Yes"
If Not ws.CurrentDocument Is Nothing Then 'Checks if it is an embedded view
If ws.CurrentDocument.EditMode Then
flag = ws.DialogBox( FORM_NAME, True, True, True , False, False , False , DLG_TITLE, Doc , True, True )
Else
flag = ws.DialogBox( FORM_NAME, True, True, True , False, False , True , DLG_TITLE, Doc , True, True )
End If
Else 'open from an action button
Select Case WhatIfNonEmbed
Case 0
MsgBox "Sorry.. You cannot open documents From the current view.", 0 + 16, "Warning"
Case 1
flag = ws.DialogBox( FORM_NAME, True, True, True, False, False , False, DLG_TITLE, Doc , True, True )
Case 2
doc.IsDialogBox = "No"
Continue = True
End Select
End If
OpenDocInDialogBox = flag
End Function
代码中的标志指的是以下内容
WhatIfNonEmbed tells how to open the document If gets opened From a non-embedded view.
WhatIfNonEmbed=0 ---- Dont Allow users To Open (meaning, doc can be only opened from the form In which it is embedded)
WhatIfNonEmbed=1 ---- Open In Dialog box.
WhatIfNonEmbed=2 ---- Normal Open using the form.
umeli已在评论中回答,但由于他没有写完整的答案,我会这样做:
QueryOpenDocument事件有一个“继续” - 变量,告诉它,文档是“真正”打开(Continue = True)还是禁止(Continue = False)。
对话框正在阻止。你的代码目前做了什么:
解决这个问题的两种可能性
Call OpenDocInDialogBox( Source, Continue, 1, "frmOrganization", "Organization")