Frontmatter
| id | 4526 |
| title | CheckBox Component: get/set value property issue |
| state | Closed |
| labels | bug |
| assignees | [] |
| createdAt | Jul 4, 2023, 9:51 AM |
| updatedAt | Sep 4, 2023, 3:09 PM |
| githubUrl | https://github.com/neomjs/neo/issues/4526 |
| author | alberthashani |
| commentsCount | 4 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Sep 4, 2023, 3:09 PM |
CheckBox Component: get/set value property issue

Hi Albert. We are kind of not supposed to change the value config at run-time, although it is possible.
value means “what do we want to submit in case the field is checked?” which is the same for most use cases.
dynamically changing the checked config will check or uncheck the field.
there is more to it when it comes to checkbox groups. There, the BE will send an array of values and only for included fields will get checked. For this part, take a look into form.Container: setConfigs().
greetings from Munich :)

Thinking more about it: we probably could add a “getGroupValue()” method, in case it helps.

Hi Tobi, thanks for the detailed response. Currently we have this issue only with a checkbox in a single context, no groups. Simply put, the checkbox X has a loaded value from the back-end for example: true, when checkbox is clicked it will assign true to it again instead of false, due to the logic in the getValue function. Let's have a call soon, and I can show you what I mean.

This is fixed now.
Checkbox component has an issue with getValue() method. if the value property is set externally to e.g. true, it will persist as true no matter what we set.
getValue logic -> return me.checked ? me.value : me.uncheckedValue