URL's in Perspective button

Hi guys, i have a popup view in which i have a button component if i click the button diff url's need to be opened based on the asset(tag value)


i am able to open a single url using component event action nav method.

So, the main thing is as you can see in tag browser there are diff assets P101-P112 in each asset folder there is a document link which is a memory tag based on selection(opening the popup window) the url need to map to the respective site which should be opened in the new window

  1. Get in the habit of using onActionPerformed rather than onClick. onClick events are triggered even if the button is disabled. onActionPerformed events are not. It will catch you out eventually.
  2. In the onClick event use a Script action rather than a Navigation action. In that you can use system.perspective.navigate - Ignition User Manual 8.1 - Ignition Documentation and all the other system.perspective - Ignition User Manual 8.1 - Ignition Documentation functions.

The idea of navigating from a popup does not sound like a good GUI design. I can't think of any office application that does this and it is likely to cause some confusion. ("What happened the popup?") Time for a re-think?

2 Likes


So the thing is @Transistor as you can see the image in maps i have pumps which is an asset if i click on any pump a popup will be displayed as you can see there is a document button below the pump image and also in overview you can see the asset id, asset status etc... i have binded these components with indirect tag binding method so if i click on the document button it should navigate to the suppliers url's there are 5 url's in component event action onactionperformed--->nav--> we can add only one url. it is not possible by using nav method as you mentioned. In scripting side also how we can do this that's my question based on asset id(Unique column) the url is in a tag also how we can do indirect tag binding something similar to that so that on clicking diff pumps the document button should open respective url's

Can you pass the document URLs (I don't understand why there are five when there's only one button) into the popup as view parameters? Then you can reference those in the onActionPerformed script.

The alternative is to use the onActionPerformed script to do a database query to get the URLs. system.db.runNamedQuery - Ignition User Manual 8.1 - Ignition Documentation would be a good place to start. You could then follow that with system.perspective.navigate - Ignition User Manual 8.1 - Ignition Documentation. The parameter method would execute faster as you'd already have the URL and wouldn't need to look it up.

Are you trying to open the URLs in different tabs with a single click? Then you should definitely use a Script action like Transistor is saying, instead of the Navigate action, and call system.perspective.navigate for each URL with newTab = True.

Your last sentence implies that maybe that's not the case and you want to just open one URL based on the pump in the popup. In that case I second Transistor's advice to do the lookup at the time the user clicks on the pump and then pass the correct URL to the popup. Alternately, maybe if you do the lookup as soon as the popup opens but before the user clicks the document button it might help disguise the delay of the lookup.

Sure i will try the alternative way and also i will paste the five diff url's. The url's are nothing but the specification of the pumps for now we will be using this url in future it may get changed to some other url based on pump vendor

KM 70 - Electric centrifugal pumps - Debem.._gaODI2NTgwMTAyLjE3MDE5NDU1MzA._ga_5B4CNXWWJVMTcwMTk0NTUyOS4xLjAuMTcwMTk0NTUyOS4wLjAuMA..#documentazione
https://cms.media.wilo.com/dcidocpfinder/wilo252558/3624554/wilo252558.pdf
https://www.tapflopumps.co.uk/wp-content/uploads/2020/01/Air-Operated-Diaphragm-Pumps.pdf
https://bdihdownload.endress.com/files/DLA/005056A500261EDE94F6C280D00A72AC/TI00426FEN_2423.pdf

first i will write a namedquery to fetch the document link according to the asset_id after that i will try to put the result(url) inside the system.perspective.navigate func if you can provide a sample how we can do this it will be really helpful

Yes @Felipe_CRM you got it right i need to open specific url based on diff pumps if you can provide any sample example it will be really grateful

What's supposed to happen when the user clicks the documentation button? Open all five documents? Where? In the main browser, as five new popups? Is the original popup supposed to remain open?

Tip: Please capitalise and punctuate your posts properly. They're difficult to read when you don't because start and end of sentences are not clear and identifying acronyms, brand names, etc., is impossible and it gives a general impression of poor attention to detail. Your script compiler won't let you away with it - so why should we? Make it easy for us.

1 Like

When user clicks on the document button it should open only one url of that particular tag as only one popup will be opened in map. If a user open another popup by clicking on the other markers the previous popup will be closed. Now, if user clicks on the document button of another asset popup it should navigate to the respective url.

When user clicks on the document button it should open only one url of that particular tag as only one popup will be opened in map.

Right, so just pass the one URL to the popup or get it by query in the popup. You don't need to handle five.

If a user open another popup by clicking on the other markers the previous popup will be closed.

You need to think how you are going to do this. The simplest is to make a popup background dismissable.

Now, if user clicks on the document button of another asset popup it should navigate to the respective url.

Still not clear. What should? The main page after closing the popup?
If it's the main page then how are you going to get it to go to load the new view?

1 Like

It is done. I have gone with the simplest way possible. So i have the document link in the tag. I have dragged and dropped a label in my flex container in perspective property edit in text I did do indirect tag binding so that the url will be displayed in the label. Now, result(url) will be displayed in the label so i did assign this url to a variable after that i have written the script system.perspective.navigate()

1 Like

There's no need to use a label for the URL; you can just hold it in a custom prop instead.

2 Likes

Thanks for the suggestion@Felipe_CRM newbie in ignition ignition will update in custom prop and work it out :innocent: .