FolderBrowserWidget loaded using WR HTML widget in Workspace tabbed perspective issue

Hello,

CS 22.4

We have a workspace that has multiple tabs where tab 1 is standard browse (shows workspace content) while tab 2 has WR HTML widget that is loading FolderBrowserWidget.

In general it works fine, however, there is a problem when we switch between tabs:

  1. Open WS and go to tab 2 (with WR widget) and FolderBrowserWidget shows the content
  2. Switch to tab 1 (standard browse widget) and navigate somewhere. I added .on("all") event on FolderBrowserWidget in WR widget and can see the event triggerd when I'm navigating in standard browse view widget. So it seems that this for some reason is also assigned here. why?
  3. When I switch back to tab 2, the WR widget is obviously not reloaded and I see blank page, e.g. no content visible in FolderBrowserWidget. I can click on filters or toggle grid view and content will appear immediately (refresh also works, but that is not what user would be doing when navigating between tabs).

I tried to make all objects in WR widget unique, e.g. they are loaded in unique <div> FolderBrowserWidget is assigned to unique variable and so on.

For example, this is added to FolderBrowserWidget in my WR, but it is also triggered when I navigate in standard browse widget (tab 1).

folderBrowserToC.on("all", function(args) {
	console.log(this);
	console.log(args);
});

And similar issue with "go.to.node.history" configuraiton. I need it only in WR widget and my loaded FolderBrowserWidget, but once the WR executes, it also gets added to standard browsing widget.

The code in WR is generic, not sure how it could be set to be specifically applied to my FolderBrowserWidget only.

csui.require.config({
	config: {
		'csui/integration/folderbrowser/commands/go.to.node.history': {
			enabled: true
		}
	}
});

Thanks,

Uģis

Tagged: