Link to another tab using dashboard button

Hello I'm trying to have a link that redirect me to another tab using a dashboard button, the thing is when I'm on http://127.0.0.1:1880/ui/#!/0 and I want the button to redirect me for example to http://127.0.0.1:1880/ui/#!/4 the URL shows in the URL bar but it doesn't redirect me to the page I unless I refresh it , and if I try other links it works perfectly. What am I doing wrong ?
here is my button

[{"id":"1e2003fa.fc243c","type":"ui_button","z":"31bffd1c.2e1ff2","name":"","group":"74304850.5a39a8","order":20,"width":"6","height":"1","passthru":false,"label":"  <a  href=\"http://127.0.0.1:1880/ui/#!/4\"  >Consulter</a>","tooltip":"","color":"","bgcolor":"#a1c45a","icon":"<img src=\"/bdd.png\" />","payload":"","payloadType":"str","topic":"","x":345.5078125,"y":1416.3752307891846,"wires":[[]]},{"id":"74304850.5a39a8","type":"ui_group","z":"","name":"Météo","tab":"16b00ee3.e42d71","order":1,"disp":false,"width":"6","collapse":false},{"id":"16b00ee3.e42d71","type":"ui_tab","z":"","name":"Tableau de bord","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Why not use the ui_control node that is designed to do this for you ? just send the number 4 into it.

2 Likes

I wasn't aware of that, it worked thanks!

How?. Im sending with a button the number 1 which is the second tab into an ui control and it doesnt work!

Good morning, how do you implement it? Since I tried it like this but it doesn't redirect me, do you have any example that you can share with us?

Show us what you tried.

1 Like

In fact, I just tried another way and it worked for me, I have a tab with the name Menu, so in the change node I put JSON {"Tab": "Menu"}, and when I hit the ui_button it works correctly, it redirects me Here I leave you my example.

[
    {
        "id": "ebc93ac2fac1d581",
        "type": "ui_button",
        "z": "bcfe12f0e599012a",
        "name": "",
        "group": "786d37a3.36fb18",
        "order": 0,
        "width": "3",
        "height": "1",
        "passthru": false,
        "label": "Menu",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "",
        "topicType": "str",
        "x": 350,
        "y": 1020,
        "wires": [
            [
                "23a7819cc5926172"
            ]
        ]
    },
    {
        "id": "b9a0ed86bf50e39a",
        "type": "ui_ui_control",
        "z": "bcfe12f0e599012a",
        "name": "",
        "events": "all",
        "x": 760,
        "y": 1020,
        "wires": [
            []
        ]
    },
    {
        "id": "23a7819cc5926172",
        "type": "change",
        "z": "bcfe12f0e599012a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"tab\":\"Menu\"}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 600,
        "y": 1020,
        "wires": [
            [
                "b9a0ed86bf50e39a"
            ]
        ]
    },
    {
        "id": "786d37a3.36fb18",
        "type": "ui_group",
        "name": "Grupo 1",
        "tab": "c72af65d.a85ef8",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "c72af65d.a85ef8",
        "type": "ui_tab",
        "name": "Tablero 1",
        "icon": "dashboard",
        "order": 1
    }
]

1 Like