I've created an "announcement" view to be used as a thin ribbon at the bottom of my Page Configuration Shared Settings. I want the user to be able to dismiss it for the rest of the session once they've read it. (It turns back on if the text changes.)
How can I get the bottom docked view to collapse to zero height on setting of
Maybe a value changed script on
view.custom.hide that calls
That's it! I have read through that section of the online manual quite a bit in the last few months and hadn't mentally registerd closeDock() or openDock().
That was easy!
Ahem, wrong post marked as solution?
Fixed thanks, Nick.
I've run into a related problem though. I'm storing the announce text as
prevText in a session variable for comparison with the current value when changing page. The idea is that I keep the dock hidden if the text is the same but it pops open again every time.
When the docked view is in the shared page configuration does it get reloaded when chaning pages? My left and top docks don't seem to flicker so I suspect not.
I'll play with it some more and see if I can define the problem better.
Hmm, in my test I found that if I close the dock and navigate to a different page, the dock will open again. If I close the dock and then navigate to the view rather than the page it maintains its closed state. So in your navigation, whether script or event I'd try to navigate to the view rather than a page(system.perspective.navigate - Ignition User Manual 8.1 - Ignition Documentation) or the event:
Thanks for that suggestion. Unfortunately I've configured a Perspective Tree to act as a menu. Selecting an item on the tree sets the tree's
props.selectionData.0.value.url : /page/parameter as created in the Page Configuration screen.
The onClick event looks like this:
def runAction(self, event):
pagePath = self.props.selectionData.value.u
so I'm not sure how to work around this.
Navigating to a page has the advantage that the URL updates, it can be bookmarked and shared and shows up in the history. According to the manual all of this is lost if navigating directly to the view and I suspect that the docks wouldn't display either.
There must be something I can do to keep the "hide" status in the session variables. I'll keep trying.