This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.
Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.
I've got a CheckBoxTree that is working and I am able to get the user selections without any problem. However, I have a situation where I need to set specific leaf nodes to selected after the tree has been constructed and I don't see an easy way to accomplish this. I tried to loop through the rows and get the path for each row, but that doesn't work for rows that are not currently visible. Any other suggestions on how to do this?
You have use get the TreePath and then use as getCheckBoxTreeSelectionModel to select it. Of course you can't use getPathForRow kind of methods if it is not visible. But it is still possible to construct a TreePath for it if you know exactly which node you are trying to select, even the node is not visible.
Do you have any examples of how this should work ?
I tried using new TreePath(treeModel.getPathToRoot(child)) to reconstruct the path to the node. I then pass this TreePath to the CheckBoxTree setSelectionPath, but my checkbox is never selected. I also tried reconstructing the path by using new TreePath(Object[]) where my object list is the list of nodes from root to child, but that didn't work either.
Not CheckBoxTree's setSelectionPath. That's for the blue highlight kind of selection, not for check boxes. As I mentioned in my previous post, you need to use getCheckBoxTreeSelectionModel to get the selection model for the checkboxes.