Tried this but I didn’t like the Title Bar that appears.
system.perspective.openPopup(‘uniqueName’, ‘popupLocation’)
Noticed that the close window was in the upper right hand corner.
Thought removing it might work:
system.perspective.openPopup(‘uniqueName’, ‘popupLocation’, showCloseIcon=False).
Then noticed that you can only move the window via the bar at the top, so I tried this.
system.perspective.openPopup(‘uniqueName’, ‘popupLocation’, showCloseIcon=False, draggable=False)
Tried sending a blank title.
system.perspective.openPopup(‘uniqueName’, ‘popupLocation’, title=’’, showCloseIcon=False, draggable=False)
Still didn’t work. Did I do something incorrectly?
You’ve done everything correctly. It looks like all of our manual testing for the popup uses Views with white backgrounds, so instances without titles displayed white-on-white - so we never saw the offending title bar. I would think that we should be able to remove the title bar in the instance a Popup
has no title
has no close icon
is not draggable
but I’m not positive… I’ll open a ticket and we’ll see what happens.
That would be good - or if it can’t be removed, allowing some way of modifying the appearance would be helpful.
I have a small popup with no title, no close icon, not draggable, and a white background. If I align some header text right at the top of the view, it doesn’t appear to be at the top at runtime, because of the white space above which blends with the white background. Instead, it just looks like I’ve mistakenly pushed all my content 20 pixels down the page.
If I make the popup background a different colour, you can see the title bar and it looks normal - but if I want a white background, and I can’t change the title bar from white, it just looks misaligned.
Just to provide some points for designing around Popups since it sounds like some of you want to get crazy and strip out the title bar (and by extension the Close Icon):
Unless you’re using a modal configuration, your popup should ALWAYS have some way to be closed or moved - whether it’s the close icon or being draggable, you don’t want to open a Popup your user can’t close. An internal strategy is to always open a Popup with a script action which sends the Popup ID as a parameter to the View being used in the Popup. It’s then the responsibility of whoever designs the View to have a Button in the View which closes the Popup (either on submit or cancel).
Think about mobile users as well - Popups are great on desktops, but not always great on mobile.
That raises a point I hadn't thought of - I do have a "dismiss" button on my popup, which is just uses a popup action to close that popup. But, by your description of passing the popup identifier to the view when opening it, I'm thinking it might be more complicated.
Presumably that action would close all instances of that popup in my particular session, hence the need to pass the identifier to the view so that it can act only on its own instance. I'm currently passing a tagPath parameter to the view, which would be unique. Let's say I'm calling this popup using an Open Popup action from an onClick even. I pass [default]Motors/Motor_1 to the tagPath parameter, and also enter that same text in the Identifier field. Then on the popup, I create a "dismiss" button, and onClick trigger a Popup Close action. I configure it to close the view with the identifier {view.params.tagPath}. Would this work, or do I have to do it via scripting? And, is there no way of scripting it to act only on itself via something like self.closePopup?
One other question - reading through the documentation for the openPopup and closePopup function, you can specify the particular session, and if you don't, it acts on the current session. So that being the case, presumably if I use the method above, it would act only on the current session by default?
Your example of using the tagPath should work just fine. I’m not sure if it’s any sort of a security concern, but the id provided to a Popup DOES appear in the Browser DOM with a “popup-” prefix attached to it.
As for the self.closePopup() idea, you’re giving the View far too much credit. Views essentially know only about their properties and their child component/container properties - Views themselves take no actions and do not interact with anything. system.perspective.closePopup() and similar methods are the system (Gateway) performing an action or gathering/manipulating/sending data through the web socket connection. Even bindings are the Gateway performing actions behind the scenes. So a View (self) or its child components/containers can’t perform actions like closing themselves or removing themselves because they’re really nothing more than a JSON holding data.
Your session conclusion is also correct - not specifying a session will result in the action only being taken on your session. Localized session interaction can be expected for EVERYTHING in Perspective, outside of Gateway-side data manipulation (tags and database) because other sessions would be viewing/accessing that same data.
Well, I was going to say that I was still experiencing this issue, but apparently I just missed the fact that the draggable parameter defaults to true. You can disregard my comments.
I think I am experiencing this issue also (v8.05) and some others. I made a popup that I load with this script:
system.perspective.openPopup(‘myPopupId’, ‘Popups/Alarm Display’, {‘Alarm Group’:‘AlarmGroup’,‘TagFolderPath’:’[default]Tagpathhere’}, position = {‘left’:250,‘bottom’:20}, showCloseIcon = False)
I’m getting a gray bar over my popup in all browsers I’ve tried (Edge, Chrome and Firefox).
@Steve_Laubach, in your example, you do not set the draggable argument to False, so it uses the default value of True. Please look more into the documentation, where we clarify the default values.
If a popup is draggable, OR (inclusive) it has a title, OR (inclusive) it has a close icon, then you can expect the title bar.
Thanks for your help (both of you). I knew about the draggable property from the help but I didn’t realize it was adding my header bar. I’m happy to see it isn’t a bug.
Hi Steve, I have the same issue where I am able to see a title bar on top when draggable is True. Is this issue still unresolved or there's any way to overcome it?
This is expected behavior, and so there is no issue to resolve. If you do not want the title bar to be present, you must set set the popup to NOT be draggable, have no title, and display no close icon.