<div dir="ltr">I think that even if a node is set to indeterminate programmatically, its parents should be updated at the very least (unless it's set to be independent). Not updating the children seems reasonable.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 18, 2022 at 11:12 AM John Hendrikx <<a href="mailto:john.hendrikx@gmail.com">john.hendrikx@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On 18/11/2022 00:10, Nir Lisker wrote:<br>
> Hi,<br>
><br>
> I have been working on fixing some issues with the behavior <br>
> of CheckBoxTreeItem. I stumbled across this situation:<br>
><br>
> When a parent is de/selected, all of its children are set to the same <br>
> state. However, a CheckBoxTreeItem can be set to indeterminate <br>
> programmatically (the control itself does not allow indeterminate). <br>
> Should all children also be set to an indeterminate state? If so, this <br>
> will put the tree at an "invalid" state where leaf nodes can be <br>
> indeterminate as well. OTOH, if not, then we are again at an invalid <br>
> state if all children have the same state, but the parent doesn't.<br>
<br>
I think the indeterminate state is best left up completely to the owner <br>
of the control. You may need information that is not part of the tree to <br>
actually determine if something is indeterminate or not.  A tree may be <br>
filtered, or a tree may represent only "nodes" while "leaves" are <br>
displayed in a 2nd control as a list.  This means that in theory, parent <br>
nodes could be indeterminate even if all its children are in the same <br>
state (checked/unchecked) due to filtering, and leaf nodes could be <br>
indeterminate if they represent a directory while the file selection is <br>
displayed in a separate control.  In Backup software, a directory may be <br>
partially selected if it has a filter associated with it (like *.java) <br>
even if that directory is empty or has only Java files currently...<br>
<br>
Some UI's will even allow you to click on an indeterminate parent node <br>
to check it (checking all children), click again to uncheck it <br>
(unchecked all children), and click a 3rd time to put it back to an <br>
indeterminate state (restoring all children to the state they had before <br>
the first click).<br>
<br>
--John<br>
</blockquote></div>