# Web Page Launch using node Template in dashboard with two tabs

**URL:** <https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445>\
**Category:** Dashboard\
**Created:** [10 January 2024 13:03 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445 "2024-01-10T13:03:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobfield/32/83723_2.png) [@bobfield](https://discourse.nodered.org/u/bobfield)\
**Post date:** [10 January 2024 13:03 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/1 "2024-01-10T13:03:21Z")

</div>

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?

Thanks,  
Roberto

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [10 January 2024 19:19 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/2 "2024-01-10T19:19:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bobfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobfield/32/83723_2.png) [@bobfield](https://discourse.nodered.org/u/bobfield)\
**Post date:** [11 January 2024 10:04 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/3 "2024-01-11T10:04:57Z")

</div>

Hi Bucksin,

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.

Thanks

[WebPageTest.txt](https://discourse.nodered.org/uploads/short-url/e3VkOHtgMSlgavNSfbjHEyPySVX.txt) (6.9 KB)

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [11 January 2024 10:27 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/4 "2024-01-11T10:27:08Z")

</div>

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:

```auto
<a href="{{msg.payload}}" target="_blank">
    <button style="background-color: blue; color: white;">Click Me!</button>
</a>

```

And from server side send it correct url whenever it needs to be updated.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 January 2024 10:39 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/5 "2024-01-11T10:39:58Z")

</div>

Also if you use a named target window instead of \_blank - at least it will only open the same window and not a new one each time.

---

<div class="post-metadata">

**Author:** ![bobfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobfield/32/83723_2.png) [@bobfield](https://discourse.nodered.org/u/bobfield)\
**Post date:** [11 January 2024 12:02 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/6 "2024-01-11T12:02:45Z")

</div>

Hi dears,

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:

msg.template = "";  
return msg;

Best Regards,

Roberto

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4e00cea7313530d49d2f84e84d8f62bb1071875a.png)

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [11 January 2024 12:06 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/7 "2024-01-11T12:06:48Z")

</div>

Can't really understand why such simple thing must be done with that kind of overkill solution ...but hey.. It's done 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 January 2024 12:07 UTC](https://discourse.nodered.org/t/web-page-launch-using-node-template-in-dashboard-with-two-tabs/84445/8 "2024-01-25T12:07:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
