Can anyone answer me one question: Is it possible to open an Vision window from Perspective via Gateway or Session scripts?
The idea is: I connect one Perspective page (via WebBrowser) in Vision, so I need open an Vision window when I click the button (in Perspective page).
I tried to do that (via Project Library script, Gateway Script and Session Script), but I get error, that nav (when I use system.nav.navigate()) is not allowed.
Thanx in Advance!
Perspective scripts run in the gateway, so there’e no system.nav you can use.
Since Perspective and Vision are separate sessions, you would probably need to use
system.util.sendMessage() to signal the Vision session to switch windows.
One problem: When I open new window in Vision, so it opening on all clients…
I tried to use “clientSessionId”, but it didn’t help… (I used Session ID variable.)
Maybe You know how to use this Message only on client who opened window…?
In the System tag Folder I didn’t find any session Id also…
and… I looked for the information about clientSessionId, but >here<… I didn’t find anything also…(((
Someone more knowledgeable than me will have to answer that one to be sure, but if it’s on the same machine, then would
session.props.host in Perspective be the same as [System]Client/Network/Hostname in Vision?
You could also pass a session ID into Perspective (for it to send back out) using a URL parameter; you would just construct the URL property on the web browser component in Vision dynamically using the system/client tag; see
https://docs.inductiveautomation.com/display/DOC80/Pages+in+Perspective#PagesinPerspective-PassingParameters(URLParameters) for more details.
The link to the page is in Vision’s WebBrowser
I don’t have any clue how to send to the Browser URL link with parameters.
Put a binding on the starting URL property, something like:
"http://gatewayip:8088/main/system/perspective/project/view?session=" + runScript("system.util.getClientId()")
in 8.1.1 this script doesn’t work…
I also tried disable this script and popoup doesn’t openat all…
when I launch a perspective without Vision (in Browser) it works, but in Vision WebBrowser PopUp doesn’t work…
in log I get this kind of message:
Flood limit tripped, starting 5000ms cooldown.
and… after update, I get the white screen
You’re running some script on the JxBrowser internals which broke because we bumped the JxBrowser version from 6 to 7. It’s not related to any of the scripting in this thread.
and how to open popups now?
Has this ever worked? A button script in Perspective, even when running in a Vision Web Browser component, is still going to execute in the gateway.
Has this ever worked?
SURE!! It works perfectly!
I decided to downgrate to version 8.0.16 only because of that problem, because we VERY need this function!
Paul suggested you’ve got some other script written against implementation details of JXBrowser 6. Can you share that script?
Specifically, whatever is being passed to
I can for sure)
The main problem was in PopUp’s sizes. When I pushed the button to open it, PopoUp was so small…
I didn’t write it by myself. I can’t remember who gave me this, but here we go:
if event.propertyName == 'componentRunning':
from javax.swing import JFrame, WindowConstants
from java.awt.event import WindowAdapter
from java.awt import Dimension, BorderLayout
from com.teamdev.jxbrowser.chromium.events import DisposeListener
from com.teamdev.jxbrowser.chromium.swing import BrowserView
from com.teamdev.jxbrowser.chromium import PopupContainer, PopupHandler
from functools import partial
def __init__(self, browser):
self.browser = browser
def windowClosing(self, e):
def showPopup(browser, initialBounds):
browserView = BrowserView(browser)
frame = JFrame("Popup")
def insertBrowser(self, browser, initialBounds):
system.util.invokeLater(partial(showPopup, browser, initialBounds))
browser = event.source.getBrowser()
def handlePopup(self, params):
Popups in JXBrowser 7
thanx! I will try it later when we back to 8.1.1 stable version…
How to refresh Vision Page?
Problem is… When happens that connection was lost, so the Client ID changes its value.
so… on the WebBrowser StartingURL:
doesn’t change when connection is back…
so… is there a way to refresh a Vision Page?
I need it for running client scripts for open Vision page.
Thanx in Advance…