如何使用导航器的 Selected 属性? [英] How do you use the Selected property of the navigator?

查看:35
本文介绍了如何使用导航器的 Selected 属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了几天时间试图弄清楚这一点,但我放弃了.

I've spent days trying to figure this out and I give up.

我是一名 LotusScript 程序员,一直在努力学习 XPage.我研究过的所有示例和示例程序都只涉及其中的一部分.

I am a LotusScript programmer and have been trying to learn XPages. All of the examples and sample programs I've studied only touch on pieces of this.

有人能一步一步地向我解释如何使用Extension Library Navigator控件的Selected属性吗?

Can someone explain to me step by step how to use the Selected property of the Extension Library Navigator control?

我根据扩展库中的布局控件创建了自己的自定义控件,并创建了一个名为 navigationPath 的自定义属性.我还创建了一个具有 5 个页面链接节点的导航器自定义控件.在每个页面链接节点的Selected"属性中,我放置了以下SSJS:

I have created my own custom control based on the layout control from the Extension Library and created a custom property called navigationPath. I also created a navigator custom control that has 5 Page Link Nodes. In the "Selected" property of each Page Link Node, I put the following SSJS:

if(compositeData.navigationPath == "/Home/ApplicationPool"){
    return true
}else{
    return false
}

/Home/ApplicationPool 对应于我放入特定页面链接节点的选择"属性中的值.

/Home/ApplicationPool corresponds to the value I put in the "Selection" property of the particular Page Link Node.

在每个布局自定义控件中,我将navigationPath"属性设置为 CompositeData.navigationPath.

In each layout custom control, I set the "navigationPath" property to compositeData.navigationPath.

我错过了什么?

推荐答案

有一个 selectedselection 属性,它们的含义非常不同,不能使用同时.在上面问题的代码示例中,您使用的是 selected 属性,在这种情况下这是错误的.

there is a selected and selection property and they mean very different things and can't be used at the same time. In the code example in your question above you are using the selected property which is the wrong one in this case.

导航器中的 treeNode 应设置为使用 selection 属性,这是一个 RegEx 值,用于查看它是否与通过自定义属性传递到应用程序布局中的值匹配.

Your treeNodes in the navigator should be setup to use the selection property, this is a RegEx value that is used to see if it matches the value passed into the application layout via the custom property.

<xe:navigator id="navigator1" expandable="true" expandEffect="wipe">
  <xe:this.treeNodes>
    <xe:pageTreeNode label="nodeName" page="/page.xsp" selection="/Home/ApplicationPool" />
  </xe:this.treeNodes>
</xe:navigator>

如您所见,您无需使用任何 SSJS 来评估真/假结果.只需将 treeNode 中的值与 XPage 的 applicationLayout 控件中的值匹配即可.

As you can see you don't need to use any SSJS to evaluate a true/false outcome. Just match the value in the treeNode to the one in the XPage's applicationLayout control.

如果您在布局 titleBar 中使用选项卡,那么您可以在那里设置一个选择属性,该属性也使用 /Home/.* 格式,这将使每个具有 的 XPage 突出显示该选项卡/Home/ 在它的导航路径自定义属性的开头.不要忘记它是 RegEx,因此可以在此处使用任何有效的 RegEx 语句,为该特定属性添加更多功能.

If your using tabs in the layout titleBar then you can set a selection property there also that uses the format /Home/.* which will make that tab highlighted for every XPage that have /Home/ at the start of it's navigationpath custom property. Don;t forget it is RegEx so any valid RegEx statement can be used here adding more power to this particular property.

这篇关于如何使用导航器的 Selected 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆