XPages Tip: Working around a Bug to Allow Collapsing Links within a Container in an xe:navigator control

I noticed a bug when working with an xe:navigator control with container nodes. The properties panel property does allow it to be expandable in 8.5.3 UP1.

By default, the navigator’s expandable property is set to true. When you add container nodes to a navigator control, you would expect that they would be expandable.

navigator_1

Here’s the source for a navigator with two levels of nested nodes.

<xe:navigator id="navigator1">
  <xe:this.treeNodes>
    <xe:basicLeafNode label="Link 1"></xe:basicLeafNode>
    <xe:basicLeafNode label="Link 2"></xe:basicLeafNode>
    <xe:basicContainerNode label="Container 1">
      <xe:this.children>
        <xe:basicLeafNode label="Child Link 1.1"></xe:basicLeafNode>
        <xe:basicLeafNode label="Child Link 1.2"></xe:basicLeafNode>
        <xe:basicContainerNode label="Container 2">
          <xe:this.children>
            <xe:basicLeafNode label="Link 1.2.1"></xe:basicLeafNode>
            <xe:basicLeafNode label="Link 1.2.2"></xe:basicLeafNode>
          </xe:this.children>
        </xe:basicContainerNode>
      </xe:this.children>
    </xe:basicContainerNode>
  </xe:this.treeNodes>
</xe:navigator>

The Problem

Even though the navigator’s expanded property was set to true, the container nodes are not collapsible — they default to being fully expanded.

navigator_2

However, I noticed that when the expandable property is deselected, an expandable attribute is added to the navigator tag and set to false. This changes line 1 from the source above to this:

<xe:navigator id="navigator1" expandable="false">

But when the property is re-selected, the expandable attribute disappears.

The Solution

The good news is that there’s an easy solution. All you need to add the expandable attribute back to the navigator tag and set it to true.

<xe:navigator id="navigator1" expandable="true">

Now there are twisties next to the container nodes that provide the ability to collapse them.

navigator_3

Another Solution

If you set the expandable property of the navigator under All Properties, it also works to set the proper attribute on the navigator.

navigator_4

Advertisements

One response to “XPages Tip: Working around a Bug to Allow Collapsing Links within a Container in an xe:navigator control”

  1. Timothy Briley says :

    Thanks. It turns out that 3 years later, the bug is still there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: