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.
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?
Put a binding on the starting URL property, something like: "http://gatewayip:8088/main/system/perspective/project/view?session=" + runScript("system.util.getClientId()")
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...
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.
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':
def addPopupHandler():
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
class MyWindowAdapter(WindowAdapter):
def __init__(self, browser):
self.browser = browser
def windowClosing(self, e):
self.browser.dispose()
def showPopup(browser, initialBounds):
browserView = BrowserView(browser)
browserView.setPreferredSize(initialBounds.getSize())
frame = JFrame("Popup")
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE)
frame.add(browserView, BorderLayout.CENTER)
frame.pack()
frame.setLocation(initialBounds.getLocation())
frame.setVisible(True)
frame.setMinimumSize(Dimension(1248, 768))
frame.addWindowListener(MyWindowAdapter(browser))
class MyPopupContainer(PopupContainer):
def insertBrowser(self, browser, initialBounds):
system.util.invokeLater(partial(showPopup, browser, initialBounds))
browser = event.source.getBrowser()
class MyPopupHandler(PopupHandler):
def handlePopup(self, params):
return MyPopupContainer()
try:
browser.setPopupHandler(MyPopupHandler())
except:
1
system.util.invokeLater(addPopupHandler, 5000)
How to refresh Vision Page?
Problem is… When happens that connection was lost, so the Client ID changes its value.
but…
so… on the WebBrowser StartingURL: