是否可以在Lotus Notes对话框中传递参数

编程入门 行业动态 更新时间:2024-10-09 04:26:33
本文介绍了是否可以在Lotus Notes对话框中传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个具有两个字段的表格,分别称为字段1"和字段2",还有一个动作按钮称为检查".在单击该操作按钮时,我想打开包含三个字段的对话框,这些字段将根据字段2的值自动填充.如何实现?

I have one form with two fields called "Field 1" and "Field 2" and one action button called "check". On click of that action button, i want to open dialog box with three fields which should get auto populate based on Field 2 value. How to achieve it?

感谢有人帮助我.

推荐答案

是的,有可能. NotesUIWorkspace.DialogBox()有一个document参数.使用此文档可将参数传递给对话框.

Yes, it is possible. There's a document parameter for NotesUIWorkspace.DialogBox(). Use this document to pass parameters to your dialog.

更新

假设您有一个名称为"MyDialogForm"的表单来表示您的对话框.

Assume you have a form with name "MyDialogForm" to represent your dialog.

它看起来像这样,包含3个字段:

It looks like that and contains 3 fields:

您有一个包含两个字段和检查"按钮的表单:

And you have a form with two fields and "Check" button:

将以下代码放入检查"按钮的点击"事件处理程序中:

Put the following code to the "Click" event handler of your "Check" button:

Sub Click(Source As Button) Const DIALOG_FORM_NAME = "MyDialogForm" Dim ws As New NotesUIWorkspace Dim dialogBoxAccepted As Boolean Dim dialogParamDoc As NotesDocument Dim currentDocument As NotesDocument Dim field2Value As String Set currentDocument = ws.CurrentDocument.Document field2Value = currentDocument.GetItemValue("Field2")(0) 'document created in-memory, but should not be saved Set dialogParamDoc = New NotesDocument(currentDocument.ParentDatabase) 'populating dialog box fields Call dialogParamDoc.ReplaceItemValue("DialogField1", "dialogField1 with: " + field2Value) Call dialogParamDoc.ReplaceItemValue("DialogField2", "dialogField2 with: " + field2Value) Call dialogParamDoc.ReplaceItemValue("DialogField3", "dialogField3 with: " + field2Value) dialogBoxAccepted = ws.DialogBox(DIALOG_FORM_NAME,True , True, False, False , False , False, "My Dialog Title", dialogParamDoc, True) If dialogBoxAccepted Then 'displaying values, entered/changed in dialog box Msgbox dialogParamDoc.getItemValue("DialogField1")(0),,"DialogField1" Msgbox dialogParamDoc.getItemValue("DialogField2")(0),,"DialogField2" Msgbox dialogParamDoc.getItemValue("DialogField3")(0),,"DialogField3" End If End Sub

此代码读取"Field2"并根据其值填充对话框字段.然后显示对话框,您可以在其中更改这些值.

This code reads "Field2" and populates dialog fields based on its value. Then it shows the dialog where you can change these values.

如果在对话框中按确定"(接受对话框),代码将显示您在对话框中更改的值.

If you pressed OK in your dialog (dialog accepted), the code will show the values you have altered in dialog box.

更多推荐

是否可以在Lotus Notes对话框中传递参数

本文发布于:2023-11-27 09:58:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637601.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   对话框中   Lotus   Notes

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!