# Dashboard Toolbar will only update on HOME tab

**URL:** <https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894>\
**Category:** Dashboard\
**Created:** [25 July 2021 20:57 UTC](https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894 "2021-07-25T20:57:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mick](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mick/32/80990_2.png) [@Mick](https://discourse.nodered.org/u/Mick)\
**Post date:** [25 July 2021 20:57 UTC](https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894/1 "2021-07-25T20:57:17Z")

</div>

I posted essentially the same question earlier with no response so I think I did a poor job with the question. I have a flow in the [HOME]Toolbar group that fetches solar activity and then I post it to the toolbar. If I refresh the Home tab the data posts properly:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/31d5ba87c07b1ffa2aa03bcd9a31cb8fffad6372.png)

When I change tabs the data is there for all tabs until I refresh the browser.

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

To get the data back I have to navigate back to the Home tab and the data is then present and when I navigate back to any other tab the data is there until the next refresh.

I have been trying to research this and have read about using the ui\_control node to force an update but I have not been successful. Trying to debug this issue I am inspecting the browser out put and notice that when there is no data the variable in the browser is set to 0:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf5a4b137edc2480a949b76c71a8983f60413680.png)

I am starting to think that a refresh is either deleting the data or for some reason it's not being picked up.

Below is the json for one function and the client / server templates.

Regards,  
Mick

```auto
[
    {
        "id": "200328b17c35c26b",
        "type": "inject",
        "z": "601d137130d1ff68",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "600",
        "crontab": "",
        "once": true,
        "onceDelay": "5",
        "topic": "",
        "payloadType": "date",
        "x": 310,
        "y": 120,
        "wires": [
            [
                "02db021a09883ba3"
            ]
        ]
    },
    {
        "id": "02db021a09883ba3",
        "type": "http request",
        "z": "601d137130d1ff68",
        "name": "getSolar",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://www.hamqsl.com/solarxml.php",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 140,
        "y": 180,
        "wires": [
            [
                "ee176491f7e60d4c"
            ]
        ]
    },
    {
        "id": "c68d1bbb02134814",
        "type": "function",
        "z": "601d137130d1ff68",
        "name": "",
        "func": "var kdx = msg.payload.solar.solardata[0].kindex[0];\nmsg.topic = \"kdx\";\nmsg.payload = kdx;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 440,
        "y": 180,
        "wires": [
            [
                "4946e617dfe4a6e9"
            ]
        ]
    },
    {
        "id": "ee176491f7e60d4c",
        "type": "xml",
        "z": "601d137130d1ff68",
        "name": "",
        "property": "payload",
        "attr": "",
        "chr": "",
        "x": 290,
        "y": 180,
        "wires": [
            [
                "c68d1bbb02134814",
                "ff8cb7addfe65ac9",
                "367061f2c2932a9f",
                "49d8a26f832c8b7d"
            ]
        ]
    },
    {
        "id": "4946e617dfe4a6e9",
        "type": "ui_template",
        "z": "601d137130d1ff68",
        "group": "12aa555ebffdaafd",
        "name": "update K",
        "order": 3,
        "width": 0,
        "height": 0,
        "format": "\n<script>\n (function(scope) {\n //hide this card. NOTE: 4b689f7473831a84 is the Node id as \n //seen in the INFO panel on the sidebar when you select this node\n $('[node-id=\"4946e617dfe4a6e9\"]').hide();\n scope.$watch('msg', function(msg) {\n if (msg && msg.topic == \"kdx\") {\n $(\"#header-kdx\").text(msg.payload);\n }\n });\n })(scope);\n</script>\n",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "local",
        "x": 600,
        "y": 180,
        "wires": [
            []
        ]
    },
    {
        "id": "7b70f8246c1cd8c0",
        "type": "ui_ui_control",
        "z": "601d137130d1ff68",
        "name": "",
        "events": "all",
        "x": 120,
        "y": 120,
        "wires": [
            [
                "02db021a09883ba3"
            ]
        ]
    },
    {
        "id": "dfb55d9d.ee5d2",
        "type": "ui_template",
        "z": "601d137130d1ff68",
        "group": "699db2e1.f6553c",
        "name": "Logo / Solar / Clock",
        "order": 1,
        "width": 0,
        "height": 0,
        "format": "<script id=\"toolbar\" type=\"text/javascript\">\n var clockInterval;\n $(function () {\n if (clockInterval) return;\n\n // add solar\n var div1 = $('<div/>');\n var p1 = $('<p>SFi</p>');\n var p2 = $('<p/ id=\"header-sfi\">');\n var p3 = $('<p>A</p>');\n var p4 = $('<p/ id=\"header-Aindex\">');\n var p5 = $('<p>K</p>');\n var p6 = $('<p/ id=\"header-kdx\">');\n \n div1.append(p1);\n div1.append(p2);\n div1.append(p3);\n div1.append(p4);\n div1.append(p5);\n div1.append(p6);\n \n div1[0].style.width = 'auto';\n div1[0].style.margin = 'auto';\n div1[0].style.display = 'flex';\n\n p1[0].style.margin = 'auto';\n p2[0].style.margin = '5px'; \n p3[0].style.margin = 'auto';\n p4[0].style.margin = '5px';\n p5[0].style.margin = 'auto';\n p6[0].style.margin = '5px';\n\n //add fof2\n var div2 = $('<div/>');\n var f1 = $('<p>foF2</p>');\n var f2 = $('<p/ id=\"header-fof2\">');\n \n div2.append(f1);\n div2.append(f2);\n \n div2[0].style.width = 'auto';\n div2[0].style.margin = 'auto';\n div2[0].style.display = 'flex';\n \n f1[0].style.margin = '6px';\n f2[0].style.margin = 'auto';\n \n // add clock\n var div3 = $('<div/>');\n var p = $('<p/>');\n\n div3.append(p);\n div3[0].style.margin = '5px 5px 5px auto';\n div3[0].style.display = 'flex';\n\n\n function displayTime() {\n var d = Date();\n var options = { timeZone: 'UTC', timeZoneName: 'short', hourCycle: 'h23', hour: `2-digit`, minute: `2-digit`};\n p.text(new Date().toLocaleString('en-US', options));\n }\n \n clockInterval = setInterval(displayTime, 1000);\n\n //add to toolbar when it's available\n var addToToolbarTimer;\n \n function addToToolbar() {\n var toolbar = $('.md-toolbar-tools');\n \n if(!toolbar.length) return;\n \n toolbar.append(div1);\n toolbar.append(div2);\n toolbar.append(div3);\n\n clearInterval(addToToolbarTimer);\n }\n addToToolbarTimer = setInterval(addToToolbar, 200);\n });\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "global",
        "x": 150,
        "y": 60,
        "wires": [
            []
        ]
    },
    {
        "id": "12aa555ebffdaafd",
        "type": "ui_group",
        "name": "Toolbar",
        "tab": "0a84fc0885f875a9",
        "order": 1,
        "disp": false,
        "width": "18",
        "collapse": false
    },
    {
        "id": "699db2e1.f6553c",
        "type": "ui_group",
        "name": "www",
        "tab": "f4b91d3a.a7533",
        "order": 2,
        "disp": false,
        "width": "24",
        "collapse": false
    },
    {
        "id": "0a84fc0885f875a9",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    },
    {
        "id": "f4b91d3a.a7533",
        "type": "ui_tab",
        "name": "Home",
        "icon": "home",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]type or paste code here

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 July 2021 21:50 UTC](https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894/2 "2021-07-25T21:50:13Z")

</div>

Tricky, sorry.

The only thing of which I can think which could be causing this is CACHE.....

Try a force refresh of the page and see what happens.

That's the best I can do at this stage.

---

<div class="post-metadata">

**Author:** ![Mick](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mick/32/80990_2.png) [@Mick](https://discourse.nodered.org/u/Mick)\
**Post date:** [25 July 2021 22:21 UTC](https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894/3 "2021-07-25T22:21:41Z")

</div>

I have tried that to no avail. I going through the ui\_control nodes again. I see there is some info about how to update tabs.

Regards

---

<div class="post-metadata">

**Author:** ![Mick](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mick/32/80990_2.png) [@Mick](https://discourse.nodered.org/u/Mick)\
**Post date:** [26 July 2021 01:42 UTC](https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894/4 "2021-07-26T01:42:11Z")

</div>

I stumbled upon the solution. To get every tab to update on refresh I had to duplicate the client nodes in a flow for each tab. I then used link in/out to connect them to the function nodes. Lastly I had to include a ui\_control node for change to inject a flow based on change.

Here is the main flow with link out nodes

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f825062289dfde25d01aa9f40ef4f972ba4e434d.png)

and here is the flow for one of the tabs with link in.

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

Regards,

Mick

---

<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 August 2021 01:43 UTC](https://discourse.nodered.org/t/dashboard-toolbar-will-only-update-on-home-tab/48894/5 "2021-08-25T01:43:09Z")

</div>

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