Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use the Selected property of the navigator?

Tags:

xpages

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

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.

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

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 corresponds to the value I put in the "Selection" property of the particular Page Link Node.

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

What did I miss?

like image 215
Mike Jackson Avatar asked Nov 27 '25 10:11

Mike Jackson


1 Answers

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.

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>

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.

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.

like image 131
Declan Lynch Avatar answered Dec 02 '25 09:12

Declan Lynch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!