I want to have a general alarm banner along the top of any page that I am on. It will just say alarms active and have a button that can take me to the full alarm page. How can I make it so I have that show up when an alarm is active and go away when it is not. I don’t want to add the banner to every page manually and I am thinking of docked views of the way to go. I tried creating a session property that is bound to active unacknowledged alarms and when that goes greater than zero, I tried a change script that opens the dock. But since it is a session property, I don’t know what page is currently open and therefore can no make it visible. Any advice? Thanks
Our solution isn’t exactly like what you describe, but it might help you out anyway.
We use a general banner for each project. This is bound in the shared settings. This houses the Horizontal Menu Component. The menu doesn’t stretch all the way from left to right, to keep space for icons and a client company logo. The Log-in icon and the company logo are permanently visible, but besides them is an alarm icon.
You could use the ‘binding to unacknowledged alarms’ that you mentioned, and bind it on the display property of the icon. This could also be a label, showing “x alarms active” in flashing white-red, or whatever catches enough attention.
Good luck with your project!
You've got the basic idea, but put that dock in the "Shared Settings" of the view manager, so it applies to EVERY page.
Don't use a session property for this. Use a custom property in the shared dock view, which is present everywhere, and has page context available for navigation.
Yeah, I have it in the shared settings. The only problem is I can’t really figure out where to call openDock and closeDock from.
Like a custom property on the view that the shared dock path is pointing to?
Don't close the dock. Alter it to be 1px tall (or wide, if on the side) instead of closed. If closed, the custom prop doesn't update (IIRC).
I endorse @JVDM's advice, which makes this functionality part of the top menu, so no need to hide the dock at all. (Just update visibility or styling of the alarm display parts in the view.)
Or if you have a dock that IS always present, like a menu, put it there (depends on how "perfect" you want your display)
So, I currently have the shared settings dock to be to the current size that I need it at all times and the display to onDemand. On the view I have a custom property that is bound to alarms active and unacknowledged. I have a change script on this that will open the dock if the value is greater than zero and close the dock when the value is equal to zero. I used a test alarm to trigger a fake state and the docked view opened on the current page I was on even without specifying a page id. It seems to have the behaviour I want even while closing it. I double checked by doing it again after the closeDock part of the script ran and it still worked. I haven’t checked about navigating to a new page though. Maybe there is another instance of the docked view that is created and therefore the script will run again and open it. Not sure. I’m going to wait for a real alarm to find out.