How do you use the Favorites property of the navigator?

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

I am a LotusScript programmer and am trying to learn XPages. All the examples and sample programs I've studied deal with only parts of this.

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

I 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 custom navigator control that has 5 nodal links per page. In the Selected property for each link to the Node page, I put the following SSJS:

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

      

/ Home / ApplicationPool matches the value I put in the Select property for a specific link to the Node.

In each custom layout element, I set the "navigationPath" property in the composite_data .navigationPath.

What did I miss?

+3


source to share


2 answers


there is a property selected

and selection

, and they mean very different things and cannot be used at the same time. In the code example in the above question, you are using a property selected

which is incorrect in this case.

Your nav must have treeNodes set in order to use the property selection

, this is a RegEx value that is used to check if it matches the value passed to the app layout using 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>

      



As you can see, you don't need to use SSJS to evaluate the true / false result. Just map the value in treeNode to the applicationLayout XPage control.

If you are using tabs in the titleBar layout, then you can set the selection property, which also uses the format /Home/.*

, which will make that tab select for each XPage with /Home/

at the beginning of the custom navigationpath property. Remember that this is a RegEx, so any valid RegEx operator can be used here to add more permissions for that particular property.

+5


source


For tree nodes in the navigator control, you define the xpage name to open and then the appropriate selection. Example:

<xe:pageTreeNode page="/text.xsp" selection="/Home/Test" label="Test page">
</xe:pageTreeNode>

      

For individual xpages, using applicationLayout, you define a value for navigationPath. If this value corresponds to an entry in one of the tree nodes controlled by naviagor, then the corresponding menu item will be highlighted in the browser. The best way to determine the navigationPath value is using a custom property (as you are using). Here's an example of this:

<xe:applicationLayout id="applicationLayout1">
        <xe:this.configuration>
            <xe:oneuiApplication navigationPath="${javascript:compositeData.navigationPath}" ...

      



You can see examples of using all of this in Teamroom Templates and Discussion Templates.

Based on my explanation of how to use it, I can see that you are not using the select property in the navigation control correctly. You just need to define a unique value for each tree node (which will then be used if it matches the navigationPath on individual xpages).

So for your specific example, change the select property to just return: "/ Home / ApplicationPool"

+2


source







All Articles