Hide a docked View with url parameter

I need to be able to hide the docked navigation View for some clients (e.g. when run inside a web browser inside of Vision, while doing a staged migration from Vision to Perspective). I just can’t get it working though by passing a param.

I have a param created on my test View view.params.showHeader which is defaulted to true. I’ve added it as a url param to the page. I’m displaying the showHeader value on the page, and when I pass “/false” to the page url, it correctly shows false.
I just don’t know how to use it. I’ve tried adding a script to close the dock if the showHeader value is false on:

  1. the View startup event handler.
    This doesn’t work as the param seems to be set after this function has run.
  2. the root's startup event handler. Same result
  3. to a change value script on the showHeader property. This doesn’t seem to fire at all. I know this because I added a line to the code to set the value of another custom property which I’m also displaying on the screen so that I know if the script has actually run or not.

What most of the time does work is finding the slowest loading component in the View and putting the code to close the dock on that, that’s assuming there is a slow-loading component. But that’s a stupid solution…

I’m not sure what to try next… any suggestions?

Edit: I found one bug with my script, still not working though. When “false” is passed in via a url parameter, it actually comes in as a unicode, not a bool. I needed to convert it into a bool before checking if it’s False in my if statement.

1 Like

I am not sure how to fix your problem, but how imperative is it that the navigation view is hidden for some users? With the URL parameter, they could just change the URL to get access to navigation view, and therefore other areas of your project, right?

Is it possible for you to use the breakpoint feature in the dock? This would assume your Vision clients browser runs at a smaller resolution then your non-vision web browsers. If you could find a happy size your dock would auto-disappear when being loaded to a devices' res smaller than the defined breakpoint.

Not an option I’m afraid, as we have vision clients of various sizes that correspond in width to any perspective clients that would be open as well. We’re essentially trying to seamlessly integrate the new Perspective views into the Vision project, while the vision project is still being used. So for each new page in Perspective, we have a new page in Vision that only has a fullscreen Web browser component whose url is tied to The new Perspective page’s url, sans navigation dock.

@chandler.teigen yes as i don’t want stacked navigation bars (the vision one and the perspective one), and I’m not showing the url in Vision so the users can’t change this.

@PGriffith @cmallonee, any ideas?

1 Like

@nminchin - did you good way to hid the docked view using a url parameter?

No, I used two page urls both pointing at the same View: one with no dock changes, the other I added a duplicate header/nav dock with it set to onDemand so that it was hidden on launch. Then I launched the latter page when I didn’t want a nav header.
Defining a shared dock again in a page will override the shared dock settings with the settings in the page dock definition

Thanks for the reply! I actually just stumbled onto that same suggestion from one of your other threads.

I will go the same route - thanks again.

1 Like