# How to enable or disable UI button when message to button input triggers button feature set?

**URL:** <https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756>\
**Category:** General\
**Created:** [23 November 2025 07:22 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756 "2025-11-23T07:22:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [23 November 2025 07:22 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/1 "2025-11-23T07:22:58Z")

</div>

How to enable or disable UI button when message to button input triggers button feature set? In the old dashboard you could do this by passing msg.enabled false to disable, and msg.enabled true to enable, and deleting msg.payload in both cases. But in the new dashboard 2.0, this does not work?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [23 November 2025 09:05 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/2 "2025-11-23T09:05:10Z")

</div>

> [@Nodi.Rubrum](#):
>
> passing msg.enabled false to disable, and msg.enabled true to enable...  
> But in the new dashboard 2.0, this does not work?

This does seem to work for me (NR 4.1.0, FFDB 1.29.0), at least my button turns ugly:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/3002fbf78b7f0fecbf89aeb545d1fc3c82999699.png)

According to [https://dashboard.flowfuse.com/nodes/widgets/ui-control#enable-disable](https://dashboard.flowfuse.com/nodes/widgets/ui-control#enable-disable) you should be able to disable a widget by passing a message to a ui-control node as below, but this doesn't work.

```auto
msg.payload = {
    pages: {
        enable: ['<Page Id>''],
        disable: ['<Page Id>']
    },
    groups: {
        enable: ['<Group Id>'],
        disable: ['<Group Id>']
    },
    widgets: {
        enable: ['<Widget Id>'],
        disable: ['<Widget Id>']
    }
}

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 November 2025 09:34 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/3 "2025-11-23T09:34:14Z")

</div>

> [@Nodi.Rubrum](#):
>
> In the old dashboard you could do this by passing msg.enabled false to disable, and msg.enabled true to enable, and deleting msg.payload in both cases. But in the new dashboard 2.0, this does not work?

It works for me. Make sure you are inject boolean true/false, not string. Test flow:

```auto
[{"id":"12e8ed66865153ba","type":"inject","z":"997da33a0beedade","name":"disable","props":[{"p":"enabled","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":270,"y":7120,"wires":[["eb015f507335250d"]]},{"id":"20bde1e7729dce51","type":"inject","z":"997da33a0beedade","name":"enable","props":[{"p":"enabled","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":270,"y":7080,"wires":[["eb015f507335250d"]]},{"id":"eb015f507335250d","type":"ui-button","z":"997da33a0beedade","group":"4f87bd59a15b847e","name":"test button","label":"test button","order":0,"width":"2","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":450,"y":7100,"wires":[[]]},{"id":"4f87bd59a15b847e","type":"ui-group","name":"test","page":"c6ff182a4185f2f2","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"c6ff182a4185f2f2","type":"ui-page","name":"Test page","ui":"ID-BASE-1","path":"/testpage","icon":"home","layout":"grid","theme":"c4cba76c368d7996","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":3,"className":"","visible":"true","disabled":"false"},{"id":"ID-BASE-1","type":"ui-base","name":"Dashboard","path":"/dashboard","appIcon":"","includeClientData":false,"acceptsClientConfig":["ui-control","ui-notification","ui-gauge-classic"],"showPathInSidebar":false,"headerContent":"page","titleBarStyle":"default","showReconnectNotification":false,"notificationDisplayTime":"1","showDisconnectNotification":true,"allowInstall":true},{"id":"c4cba76c368d7996","type":"ui-theme","name":"Test theme","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}},{"id":"973001a83d7b2ca3","type":"global-config","env":[],"modules":{"@flowfuse/node-red-dashboard":"1.29.0"}}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 November 2025 09:36 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/4 "2025-11-23T09:36:13Z")

</div>

> [@jbudd](#):
>
> According to [Control ui-control | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/nodes/widgets/ui-control#enable-disable) you should be able to disable a widget by passing a message to a ui-control node as below, but this doesn't work.

I think that is an error in the docs.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 November 2025 09:54 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/5 "2025-11-23T09:54:39Z")

</div>

> [@Colin](#):
>
> I think that is an error in the docs.

No I am wrong, there is code in the dashboard source that says it does what the docs say, so this is a bug. @jbudd could you submit an issue please?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [23 November 2025 09:56 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/6 "2025-11-23T09:56:01Z")

</div>

> [@Colin](#):
>
> an error in the docs.

I saw where you said that in another thread Colin, which was why I was confident in my experiment showing this doesn't work for widgets.  
However, I couldn't get it to disable a page either so maybe I misunderstood the documentation, or I might have omitted the s of pages?  
Also I had to put double quotes around all the keys and array elements in that js object in order to inject it, perhaps that broke the ui-update.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 November 2025 10:26 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/7 "2025-11-23T10:26:21Z")

</div>

I believe that it has worked for groups and pages. I haven't tested it recently though.

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [24 November 2025 19:07 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/8 "2025-11-24T19:07:14Z")

</div>

so I found that msg.enabled true/or false does still work for some nodes, some times, i.e. the new buttons in dashboard 2.0... but does not seem to work for tables... if memory serves, have to validate. but even deleting the msg.payload when sending msg.enabled to the new buttons, has odd results as I noted in my original post/question?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 November 2025 20:41 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/9 "2025-11-24T20:41:05Z")

</div>

> [@Nodi.Rubrum](#):
>
> does not seem to work for tables

Could you submit an issue for this please.

> [@Nodi.Rubrum](#):
>
> even deleting the msg.payload when sending msg.enabled to the new buttons, has odd results as I noted in my original post/question?

Can you describe what problem you are still seeing with buttons? Your original post just says it doesn't work?

---

<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:** [22 February 2026 20:41 UTC](https://discourse.nodered.org/t/how-to-enable-or-disable-ui-button-when-message-to-button-input-triggers-button-feature-set/99756/10 "2026-02-22T20:41:30Z")

</div>

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