# Retaining state information in a Dashboard 2 ui-template

**URL:** <https://discourse.nodered.org/t/retaining-state-information-in-a-dashboard-2-ui-template/86007>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [28 February 2024 16:39 UTC](https://discourse.nodered.org/t/retaining-state-information-in-a-dashboard-2-ui-template/86007 "2024-02-28T16:39:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<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:** [29 February 2024 07:16 UTC](https://discourse.nodered.org/t/retaining-state-information-in-a-dashboard-2-ui-template/86007/13 "2024-02-29T07:16:43Z")

</div>

I believe that `this.msg` is reference to same object you'll get back as replay. It works obviously. Doesn't it? For dialog it works why not for others?

EDIT: Wait, Ill check something and come back with it. Cos we are talking a bit different situations maybe...

With msg watcher:

```auto
watch: {
        msg: function(){    
            if(this.msg.payload != undefined){     

```

You get replay message and only way to get rid of it is to send msg with `payload = null`

With direct socket listening:

```auto
mounted() {            
            this.$socket.on('msg-input:' + this.id, function (msg) {                
                console.log("msg from socket:",msg)

```

You don't get any replay messages what so ever.  
Still you can listen replay by watching msg and do whatever symbiosis then

---

_[View the full topic](https://discourse.nodered.org/t/retaining-state-information-in-a-dashboard-2-ui-template/86007)._
