问题描述
使用 SSJS 我有一个 NotesXSPViewEntry 的句柄,它是视图中的一个类别,现在我需要从该条目中获取父类别作为 NotesViewEntry,所以我尝试使用 NotesXSPViewEntry.getParent() 但它返回一个 notesViewNavigator一个 NotesViewEntry.
Using SSJS I have a handle to a NotesXSPViewEntry which is a category in view,now I need to get the parent category from that entry as a NotesViewEntry, so I tried to use NotesXSPViewEntry.getParent() but that returns a notesViewNavigator instead of a NotesViewEntry.
如何从 notesXSPViewEntry 获取父 NotesViewEntry?或者如何将 notesXSPViewEntry 转换为 NotesViewEntry?
How do I get the parent NotesViewEntry from the notesXSPViewEntry? or how do I convert a notesXSPViewEntry to a NotesViewEntry?
推荐答案
一个解决方案:使用 getNavigatorPosition()
获取位置.使用 getParent() 获取 NotesViewNavigator,使用该位置作为参数调用 gotoPos()
,然后 getPrev()
应返回上一个条目和 getParent()
父条目.
One solution: get the position with getNavigatorPosition()
. The get the NotesViewNavigator with getParent(), call gotoPos()
with that position as parameter, then getPrev()
should return the previous entry and getParent()
the parent entry.
您也许可以不使用 gotoPos() 调用:getParent().getCurrent().getParent()
应该返回 XSPViewEntry 的导航器的当前条目的父条目.
You might be able to leave the gotoPos() call out: getParent().getCurrent().getParent()
should return XSPViewEntry's navigator's current entry's parent entry.
这篇关于如何从 NotesXSPViewEntry 获取父 NotesViewEntry?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!