问题描述
我需要在Navigator Control的数据库中创建可用视图的链接。我没有找到该控件的计算公式区域。就像我们使用combobox的代码:
I need to create links of available views in database on Navigator Control. I did not find any computed formula area for that control. Just like we use code for combobox:
var v = database.getViews();
var a = []
for(var i=0; i<v.size(); i++) {
a[i] = v[i].getName()
}
return a
实现之后,动态视图面板将显示选择视图的ext图书馆。
请指导我如何做到这一点。感谢提前。
After achieving that, the select view will display by Dynamic View Panel of ext library.Please guide me how to do this. Thanks in advance.
-MAK
推荐答案
您可以创建一个< xe:navigator>
中的< xe:repeatTreeNode>
的数据库中的每个视图的导航条目:
You can create a navigation entry for each view in you database using the <xe:repeatTreeNode>
in the <xe:navigator>
:
<xe:navigator id="outline" expandable="true">
<xe:this.treeNodes>
<xe:repeatTreeNode loaded="true" indexVar="index" var="crrView" value="#{javascript:return database.getViews();}">
<xe:this.children>
<xe:basicLeafNode label="#{javascript:crrView.getName();}" loaded="true">
</xe:basicLeafNode>
</xe:this.children>
</xe:repeatTreeNode>
</xe:this.treeNodes>
</xe:navigator>
此代码将为您的数据库中的每个视图生成一个导航。您可以使用< xe:basicleafNode>
中的变量 crrView
来获取 database.getViews()
在循环中。
This code will generate a in you navigation for each view in your Database. You can use the variable crrView
in the <xe:basicleafNode>
to get current element of the Vector returned by database.getViews()
in the loop.
您还可以使用其他元素,然后 < xe:basicLeafNode>
在< xe:repeatTreeNode>中。
在导航控件的NavigationItems窗口中选择RepeatNode,然后单击添加孩子。
You can also use other elements then the <xe:basicLeafNode>
in the <xe:repeatTreeNode>.
Select the RepeatNode in the NavigationItems window of the navigatior control and click on add Child.
这篇关于XPages:动态填充导航器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!