# How to Redirect Tab using UI Control Node without timeout

**URL:** https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717
**Category:** Dashboard
**Created:** [3 June 2020 14:11 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717 "2020-06-03T14:11:41Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)
#### Post date: [3 June 2020 14:11 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/1 "2020-06-03T14:11:42Z")

</div>

My flow has a template node with this:

```auto
<div layout="row" layout-align="space-between">
  <img src={{msg.payload}} alt="floorplan missing" usemap="#workmap" width="300" height="340">
    <map name="workmap">
      <area shape="rect" coords="150,0,300,105" alt="Whitebox 3" href="whitebox3"> 
      <area shape="rect" coords="185,105,300,150" alt="Whitebox 2" href="whitebox2"> 
      <area shape="rect" coords="185,150,300,200" alt="Whitebox 1" href="whitebox1"> 
      <area shape="rect" coords="150,200,490,350" alt="Townhall" href="townhall"> 
      <area shape="rect" coords="0,200,150,350" alt="Stage" href="stage"> 
    </map>
</div>

```

Then I catch the GET request by an HTTP in node set to GET /ui/stage as example.  
I'm able to click the area and it switches the tab but times out after a few seconds.  
I tried to add a `msg.statusCode:200` but that does not help. How can i prevent my browser to search for the not existing `/ui/stage` page after changeing the tab?

 ![Bildschirmfoto 2020-06-03 um 16.06.03](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a1458c2175ae3f9bbdd726fac6e9bcdd33920866.png)

---

<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: [3 June 2020 14:37 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/2 "2020-06-03T14:37:16Z")

</div>

the ui\_control node does not really pass messages through.. there are some it sends to the dashboard and some that it receives. Net is that it doesn't pass through the msg.req and msg.res properties from the original message and so the http response node fails. - You can probably just wire them in parallel and send the message to both the ui\_control and http response at the same time.

---

<div class="post-metadata">

### Author: ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)
#### Post date: [3 June 2020 14:54 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/3 "2020-06-03T14:54:19Z")

</div>

That brings me to a blank page that has the payload as text.  
If I delay the second 'direct' connection it first brings me to the correct tab and then after the delay times out it shows a blank page with payload as text.  
Do you have a sample how `ui control` node should be used to switch tabs?

---

<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: [3 June 2020 15:02 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/4 "2020-06-03T15:02:24Z")

</div>

personally I would do something like

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee8329dca0960a1c642d23c89261f91cb9f2df27.png)  
and have just a single endpoint (in this case /change  
that expects a get query like ?tab=1 or ?tab=2  
to change to tab 1 or 2 etc

---

<div class="post-metadata">

### Author: ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)
#### Post date: [3 June 2020 15:06 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/5 "2020-06-03T15:06:43Z")

</div>

But that's hard-coded to the tab n°. Is there no solution for tab names?  
I mean that's what the `ui controll` tells in the info:

```auto
Allows dynamic control of the Dashboard.

The default function is to change the currently displayed tab. 
msg.payload should either be an object of the form {"tab":"my_tab_name"}, 
or just be the tab name or numeric index (from 0) of the tab or link to be 
displayed.

```

---

<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: [3 June 2020 15:30 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/6 "2020-06-03T15:30:19Z")

</div>

well ok use the names then ?tab=Whitebox%201 -- but then you have to handle/decode the spaces (%20) etc...

---

<div class="post-metadata">

### Author: ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)
#### Post date: [4 June 2020 06:36 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/7 "2020-06-04T06:36:49Z")

</div>

> [@dceejay](#):
>
> ?tab=Whitebox%201

Have a look in to my [first post](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717) the href is without white space. I think I do not need to encode with. Or do you think the href has to be in line with the tab name?

What happens is this:  
`/ui/?tab=whitebox1#!/0?socketid=QF0rfwHp3wnsijNBAABw`

This is my current situation:

 ![Bildschirmfoto 2020-06-04 um 08.34.48](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/75864986659f4b332106889b4606212f504f06df.png)

but also aligned with the tab name it does not work:  
changeing area line 4 `href="?tab=Stage"`

 ![Bildschirmfoto 2020-06-04 um 08.38.51](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13e05c28f4a8b519594030c92581e24ee4cfea28.png)  
that leads to this url:  
`/ui/?tab=Stage#!/0?socketid=PCkSQG_8-vnYglprAABx`

In fact, it does not change tab. It stays.

---

<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: [4 July 2020 06:37 UTC](https://discourse.nodered.org/t/how-to-redirect-tab-using-ui-control-node-without-timeout/27717/8 "2020-07-04T06:37:00Z")

</div>

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