Im working on an advanced prototype of a filter and im trying to change the state of an object with the click of a different object.
Each object in the component “Checkbox Item” has the following naming:
- Hint=false, Selected=false, State=default, Indeterminate=false (unchecked)
- Hint=false, Selected=true, State=default, Indeterminate=false (checked)
- Hint=false, Selected=false, State=default, Indeterminate=true (semi-checked)
Each of these object has 3 nested components/objects inside of it:
- Check box
- Text (this is not a variabel)
- Amount → this has a nested object inside it called #Count
The idea is that when i press a checkbox, the #Amount boolean is set to True/False (based on state) and the #Count variable goes up + or - 1.
So far so good, i have gotten all the children/checkmarks below Arbetsmarknadsförvaltningen (6 in total) to a) show/hide #Acount, b) check/uncheck boxes and c) add/subtract 1 from #Count
The problem is that i want to make a more advanced function, where if more than one of the children under Arbetsmarknadsförvaltningen is set to True (checked), the checkbox in Arbetsmarknadsförvaltningen should be set to Indeterminate.
All of the children below Arbetsmarknadsförvaltningen has been connected to a boolean variable and their naming is Object 1 etc (until 6) If we look at the first child–> Livsmedelskontrollen, it has the following syntax:
Everyting works great but when i adde the last interaction, nothing happens. The lines are:
if #count > #total → created a number variable called #total with the value 6
set Avdelning parent → this is the variable i have connected to Arbetsmarknadsförvaltningen
Indeterminate == true
I dont know what im doing wrong, can anyone help me? Im not a programmer but i can understand the logic but right now i just dont know whats happening.