I am trying to use the Responsive Navigation Bar in the latest version of the Xpages Extension Library. It seems to work well but I cannot figure out how to set a link to active.
Below is part of my code. What should I do to make a leaf node be active (i.e. look selected)?
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xe:navbar
id="custom-navbar1"
fixed="unfixed-top"
pageWidth="fluid"
inverted="true"
headingStyle="font-weight:bold;">
<xe:this.navbarBeforeLinks>
<xe:basicLeafNode label="Scoular">
<xe:this.onClick><![CDATA[window.open("http://www.scoular.com","_blank")]]></xe:this.onClick>
</xe:basicLeafNode>
<xe:basicLeafNode label="PC Checklist">
<xe:this.onClick><![CDATA[var url = "http://kc1/Bryan/PCCheckList2.nsf/xpHome.xsp"
window.location = url]]></xe:this.onClick>
</xe:basicLeafNode>
<xe:basicLeafNode label="Help Desk">
<xe:this.onClick><![CDATA[var url = "http://kc1/Bryan/HelpDesk.nsf/xpHome.xsp";
window.location = url]]></xe:this.onClick>
</xe:basicLeafNode>
</xe:this.navbarBeforeLinks>
</xe:navbar>
</xp:view>
I have changed from using the Native Control to using pure Bootstrap. It works well, except I cannot get the log in that I grabbed from the excellent To Do application to align properly.
It looks like this:
The "Welcome, null" doesn't look like the other controls. I will put my code in below and maybe you can point out what is wrong.
I also am wondering how to make the decision to use Xpage controls or native? I know I read in Stack Overlow some people who said that as their application grew they ran into some limitations with the Xpages nabber. Maybe I should just go back to using it and fix the highlighting problem as you suggested?
The solution I eventually settled on was to put two Basic Leaf Nodes in and render one depending on whether it should be highlighted or not.
> <xe:basicLeafNode
> title="PC"
> label="PC"
> style="color:rgb(255,255,255)">
> <xe:this.rendered><![CDATA[#{javascript:if (database.getFileName() == "PCCheckList2.nsf") {return true} else {return false}}]]></xe:this.rendered>
> <xe:this.href><![CDATA[#{javascript:var url = "notes://KC1/Bryan/PCCheckList2.nsf/xpHome.xsp?OpenXpage"; var url2 =
> "http:apps.scoular.com/Bryan/PCCheckList2.nsf/xpHome.xsp?OpenXpage";
> url2}]]></xe:this.href> </xe:basicLeafNode> <xe:basicLeafNode
> href="xpMain.xsp"
> title="PC"
> label="PC"
> enabled="false">
> <xe:this.rendered><![CDATA[#{javascript:if (database.getFileName() != "PCCheckList2.nsf") {return true} else {return
> false}}]]></xe:this.rendered> </xe:basicLeafNode>