Data binding state logic question

I have a checkbox, and I would like to use the “checked state” logic to set a property in the parent data model. If I just give the component the property name in the field for “checked state”, I can set the value of my property by checking or unchecking the checkbox. That is normal/expected behavior, all good:

image

However, when I use Codeless logic in the “checked state” area to manipulate the state of my checkbox, it no longer binds to the property in my data model:

The checkbox displays as expected (according to the logic), but its state no longer databinds to the relevant property in my data model.

I would like to set/unset the value for the “intervalError” property in my data model using logic (logic which calculates a result based on the values of other properties in the data model). Is this not possible? How to accomplish this? This question/challenge is perhaps somewhat related to this discussion.

Hi @Alex_Klein

Yes, this is by design

Using the DataBinding input is a shortcut of two handlers “On Change Event” and “Value Logic”, it means when you need an easy way to set up a bidirectional data biding you use the input.

However, when you are looking the more complex but more customizable way you need to add logic for both these handlers:

  1. On Change event you check/validate/modify/etc data and then set it to any data model
  2. Value/State Logic handler you get value from anywhere and then you can modify it before returning to the component UI

Regards,
Vlad

right, but the “on change” event is not triggered by changes in the value of the component (which occur via Value Logic). “On change” is only triggered by a user clicking on something… and if the component has “value Logic”, the user cannot actually interact with the component, it is “hard wired” to get its value from logic. Oh well, thought I would ask :grinning: