Switch selected navigation tree tab after action triggered
Hi,
We have added a new type of document list (documentslists-contrib.xml) to give users the ability to bookmark documents. It is displayed at the bottom of the navigation tree, aside others document lists (selection and clipboard).
I have successfully put this document list in the top tab group, as a navigationTree, to give a better accessibility. Now, I would like to get the same behavior than before: my tab automatically selected when I add a document to this list, like when it was a bottom tab.
Looking at the code, I saw that a Events.instance().raiseEvent(listName + “Updated”); is fired when a document is added to a list. But I haven't found a way to listen to this event.
Moreover, I don't know how to select a navigation tree tab after an action has finished. I have tried directoryTreeManager.setSelectedTreeName(“bookmarks”); at the end of my action without success.
To sum up, I would like to select the right tab in navigation tree either by listening at the event raised by DocumentListManager or by calling a method after my action has executed to set the current selected navigation tree.
Thanks.
Stéphane
hello,
you can use multiNavTreeManager.setSelectedNavigationTree(“bookmarks”), as multiNavTreeManager.selectedNavigationTree is the value checked to select a tab in the navigation tree
Thierry
In fact, the key is that directoryTreeManager.setSelectedTreeName() doesn't store really the selected navTree. The selected one is stored under multiNavTreeManager#selectedNavigationTree (information from the core of the method multiNavTreeManager.setSelectedNavigationTree()).