2013-07-15 50 views
0

在Lotus Notes项目中,很容易在QueryOpen方法中自动访问当前文档,例如,从NotesUIDocument(参数)中提取它。如何使用Javascript获取当前NotesDocument?

Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant) 

    //Here I get the document 
    Dim doc as NotesDocument 
    Set doc = Source.document 

End Sub 

我怎样才能做到这一点,但在网上工作,使用Javascript?当然,不一定在QueryOpen方法中。

+1

你想实现什么?要访问“字段”,你可以简单地做一个var doc = document.forms [0] ...并通过doc.FieldName.value访问字段...但是在xpages中将会完全不同 –

+0

@Tode document.forms [0 ]工程。如果需要,请将其作为答案发布,并将其设置为最佳答案 – cgalvao1993

+2

要明确指出,通过JavaScript DOM访问字段与访问当前NotesDocument不同。它更类似于访问当前的NotesUIDocument和使用fieldGetText。 –

回答

2

如果你只是想访问文档字段,那么它是一件容易的事要做:

var doc = document.forms[0]; 
var yourfield = doc.YourFieldName; // take care: fieldname is case sensitive 
// to get a field- value; 
var theValue = yourfield.value; 
// to set a field value 
yourfield.value = "AnotherValue"; 

XPages中因为有你有JavaScript类具有相似/同样的方法/属性,因为这做法完全不同NotesDocument类来模仿LotusScript行为

相关问题