Hi,
I have a dashboard with two screens (tabs). The first has a button that when clicked opens a web page in the browser, using the node template with an HTML program. When I go to the second screen and return to the first, the web page always launches even without me clicking the button. Any suggestion?
I am no expert but it seems likely that something triggers the input to the template node when you return to the second tab. Set a debug on the input to the node to see where it is coming from. You could try the ui_control node to stop this.
I did the debug, and the web page triggering is done internally by node-red without triggering my nodes. I attach a very simple program that shows the problem. If you want to see this challenge, click on the web page, switch to screen 2 and return to screen 1. You will see that the web page is always displayed.
This behavior is called the "replayMessage". It can't be turned off just like that so you'll have to live with that. For sure it does not allow you to create links in the way you did.
I think you are trying to have one button but depending on some state you want it to open different urls, just use simple ui_template with something like this:
I believe that after several attempts, I get to solve it, and I thank everyone for their help. The solution is to clean the template after using it, adding a new node function: