# "Deploy" disabled after changes to node config using UI

**URL:** <https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361>\
**Category:** General\
**Created:** [1 June 2022 13:27 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361 "2022-06-01T13:27:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiobeoni](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fabiobeoni/32/57768_2.png) [@fabiobeoni](https://discourse.nodered.org/u/fabiobeoni)\
**Post date:** [1 June 2022 13:27 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/1 "2022-06-01T13:27:54Z")

</div>

Hello,

I made a custom node with some config properties... When from the UI I change one value of the config and I press "Done", the Deploy button is not enabled. BTW my custom nodes receive the config values.

Do I need to trigger manually some event to notify NodeRED that I need the Deploy button enabled?

Thanks.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [1 June 2022 14:01 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/2 "2022-06-01T14:01:47Z")

</div>

Hi @fabiobeoni

in general, no, you do not need to trigger anything manually. The editor compares the node configuration before and after it has been edited and will enable the deploy button if it detects any changes.

Are you sure your custom node is applying the changes properly?

---

<div class="post-metadata">

**Author:** ![fabiobeoni](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fabiobeoni/32/57768_2.png) [@fabiobeoni](https://discourse.nodered.org/u/fabiobeoni)\
**Post date:** [7 June 2022 14:38 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/3 "2022-06-07T14:38:19Z")

</div>

That's how I configure my property and read the value...

```auto
// I have a "dataref" typed input

 <div class="form-row">
        <label for="node-input-dataref"><i class="fa fa-tag"></i> Data Ref</label>
        <input type="text" id="node-input-dataref">
 </div>

// registering the node

defaults: {
        dataref: {
            required:false
        }
}

dataref:function (){
        return this.dataref;
},

oneditprepare:function (){
  const $dataRefInput = $('#node-input-dataref');

  $dataRefInput.typedInput({
            type:"json",
            types:["jsonata", "json"]
   });

  // set defaults and read the value on change
   $dataRefInput.typedInput('value', this.dataref || '');
   $dataRefInput.on('change',()=> this.dataref = $dataRefInput.val());
   this.dataref = $dataRefInput.val();
}

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [7 June 2022 15:20 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/4 "2022-06-07T15:20:27Z")

</div>

> [@fabiobeoni](#):
>
> ```auto
> dataref:function (){
> return this.dataref;
> }
> 
> ```

What is this supposed to be doing?

I think you are attempting to declare `dataref` as a function in `this` scope? That is not necessary. By defining `dataref` in the `defaults`, `this.dataref` it is generated for you.

---

<div class="post-metadata">

**Author:** ![fabiobeoni](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fabiobeoni/32/57768_2.png) [@fabiobeoni](https://discourse.nodered.org/u/fabiobeoni)\
**Post date:** [7 June 2022 15:43 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/5 "2022-06-07T15:43:39Z")

</div>

I though they were required... getters.

BTW removing them does not resolve the issue ☹

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [7 June 2022 15:48 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/6 "2022-06-07T15:48:57Z")

</div>

Try...

```auto
 <div class="form-row">
        <label for="node-input-dataref"><i class="fa fa-tag"></i> Data Ref</label>
        <input type="hidden" id="node-input-datarefType">
        <input type="text" id="node-input-dataref">
 </div>

```

```auto
defaults: {
    dataref: {
       required:false
    }
},
oneditprepare:function (){
   $('#node-input-dataref').typedInput({
       type:"json",
       types:["jsonata", "json"],
       typeField: $("#node-input-datarefType")
   });
}

```

---

<div class="post-metadata">

**Author:** ![fabiobeoni](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fabiobeoni/32/57768_2.png) [@fabiobeoni](https://discourse.nodered.org/u/fabiobeoni)\
**Post date:** [8 June 2022 10:00 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/7 "2022-06-08T10:00:33Z")

</div>

nope ☹

Why do I need an input hidden?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 June 2022 11:20 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/8 "2022-06-08T11:20:21Z")

</div>

> [@fabiobeoni](#):
>
> Why do I need an input hidden?

It is used to maintain state without you having to get/set the value manually.

Is your code on a repository somewhere?

> [@fabiobeoni](#):
>
> nope ☹

Yeah, I forgot to add a default for the type & to add a `value` property in the `dataref`...

```auto
defaults: {
    dataref: {
       value: '',
       required:false
    },
    datarefType: {
        value: 'json'
    }
},
oneditprepare:function (){
   $('#node-input-dataref').typedInput({
       type:"json",
       types:["jsonata", "json"],
       typeField: $("#node-input-datarefType")
   });
}

```

---

<div class="post-metadata">

**Author:** ![fabiobeoni](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fabiobeoni/32/57768_2.png) [@fabiobeoni](https://discourse.nodered.org/u/fabiobeoni)\
**Post date:** [8 June 2022 12:16 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/9 "2022-06-08T12:16:51Z")

</div>

I got it...

Basically the `on change` handler made the issue...

```auto
$dataRefInput.on('change',()=> this.dataref = $dataRefInput.val());

```

Looks like you don't need to look up for changes by your self, NodeRED does that in your behalf. So, due to the value update `this.dataref = ` NodeRED didin't see any change in its own value compare checking algoritm.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 June 2022 13:48 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/10 "2022-06-08T13:48:13Z")

</div>

> [@fabiobeoni](#):
>
> Basically the `on change` handler made the issue...
> 
> ```auto
> $dataRefInput.on('change',()=> this.dataref = $dataRefInput.val());
> 
> ```
> 
> Looks like you don't need to look up for changes by your self, NodeRED does that in your behalf

That is why my example code excluded it

> [@Steve-Mcl](#):
>
> ```auto
> defaults: {
> dataref: {
> value: '',
> required:false
> },
> datarefType: {
> value: 'json'
> }
> },
> oneditprepare:function (){
> $('#node-input-dataref').typedInput({
> type:"json",
> types:["jsonata", "json"],
> typeField: $("#node-input-datarefType")
> });
> }
> 
> ```

... and why I said ...

> [@Steve-Mcl](#):
>
> > [@fabiobeoni](#):
> >
> > Why do I need an input hidden?
> 
> without you having to get/set the value manually.

---

<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 June 2022 13:48 UTC](https://discourse.nodered.org/t/deploy-disabled-after-changes-to-node-config-using-ui/63361/11 "2022-06-22T13:48:22Z")

</div>

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