# Tag Binding on Numeric Text Field with Bidirectional Off

**URL:** <https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549>\
**Category:** Ignition\
**Created:** [November 11, 2020, 6:05pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549 "2020-11-11T18:05:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [November 11, 2020, 6:05pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/1 "2020-11-11T18:05:57Z")

</div>

Hello,

If you have a tag binding on a numeric text field that was not set to bidirectional and you have a button change the value of that field, the field changes to what the button tells it to but the tag itself does not.

In my opinion, the button script should attempt to change the field but the binding on the field should block it instead of changing the field value but not the tag.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 11, 2020, 6:58pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/2 "2020-11-11T18:58:34Z")

</div>

That’s not how bindings have ever worked, in Vision or Perspective. As soon as the tag value changes again, the change sent from the button will be overwritten. What you’re describing would be a breaking change from how bindings have always worked - at minimum, one more thing to configure for every single binding.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 11, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/3 "2020-11-11T19:17:23Z")

</div>

The button should write to the tag, not the field.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [November 11, 2020, 7:19pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/4 "2020-11-11T19:19:13Z")

</div>

I see what your saying but I will say it can be kind of misleading that when you bind a field to a tag, that the field can actually display something that is different to the bound tag.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [November 11, 2020, 7:19pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/5 "2020-11-11T19:19:45Z")

</div>

Is that like a best practices thing? Doing things this way as standard practice would certainly ensure that the field’s displayed value is the same as the tags value.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 11, 2020, 7:27pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/6 "2020-11-11T19:27:05Z")

</div>

> [@dion.botha](#):
>
> that the field can actually display something that is different to the bound tag.

Actually, it is very useful when implementing a user interface that writes many fields back to corresponding tags when a user clicks a "save" button or otherwise confirms.

Consider adding a couple custom properties to each of your fields:

1. A boolean named `Dirty`, and
2. Something named `Raw` that matches the type of the field.

Move your field's tag binding to the `Raw` property and make it bidirectional. Add a unidirectional property binding to pull the raw value to the field's editable property. Add an expression binding for `Dirty` that compares `Raw` != field value.

Style your field with `Dirty`. (I like yellow backgrounds for fields with unsaved changes.)

The save button actionPerformed script would copy all of the dirty fields editable property to the `Raw` property, letting the bidirectional binding handle the tag write.

Without unidirectional bindings, bulk "save" or "confirm" logic would be much more trouble.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [November 11, 2020, 7:35pm UTC](https://forum.inductiveautomation.com/t/tag-binding-on-numeric-text-field-with-bidirectional-off/40549/7 "2020-11-11T19:35:23Z")

</div>

Thanks for your time in explaining!
