hey!
I did the navigation the other way:
I don’t use Vision Menu Tree. Now I use Perspective Menu Tree, so now it works without any Gateway scripts.
But now I have the other problem: I cant open url in new tab via script system.perspective.navigate(url=‘link’)…
I searched for the information about it on the forum and I found that it’s impossible
I need to open new link in new window, because IFrame can’t show me GoogleMap
Error running action 'component.onItemClicked' on MAP_Vision (1)@C/root/Content/MENU/MenuTree: Traceback (most recent call last): File "function:runAction", line 39, in runAction File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\webbrowser.py", line 26, in open_new return self.open(url, 1) File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\webbrowser.py", line 23, in open raise Error(e) webbrowser.Error: java.io.IOException: Failed to open Google Maps. Error message: An error occurred in sending the command to the application.
from com.inductiveautomation.ignition.client.util import BrowserLauncher
BrowserLauncher.openURL("https://google.com")
Another option, depending on your platform, is system.util.execute - Windows has a start executable that will open a link with the associated default program, and on most Linux desktops you could use xdgopen.
thanx guys!
but nothing’s working for me… Unfortunately…
actually it’s strange why system.perspective.navigate doesn’t have the function NewTab…
I think it’s very important to have this!
Hope the function will be presented in the future…
All the examples given were examples for Vision, not perspective. Perspective scripts run on the gateway, so you can't launch other applications there.
In HTML, it would be as simple as adding a target to a link, but I don't know perspective well enough to know how you should achieve this in perspective.
@Sanderd17 ‘s response made me take a step back and re-read the original post. I apologize for potentially leading you down the wrong path.
If you are using the Perspective Menu Tree, there is a “target” property in each of your items. You may place an external url there and it should open in a new tab
Otherwise, you might look into placing the Link Component on a page for navigation.
I would be interested in knowing whether this solves your problem or if you still need some way to do this via scripting.
Can You give me one advise about how to check if I pressed “BACK” in menu tree?
I thought I can get a path for that with value “0”, but it gives no path if I press “BACK”…
so… how to know if I pressed back?
You may also want to start a new topic: hoping for an answer on a four-year-old topic from some who hasn't event visited the forum in almost that long is probably unrealistic.