Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
hierarchical display of components
well, I am aware of Tree in Vaadin. It allows me to show data organized hierarchicaly. All good.
However, I am not sure if it is good for the following problem, and I am also asking if there is any component that I can use.
So, I have AObject that has a set of BObject, and my BObject has a set of CObject. For clarity, my tree would have two type of nodes. One for BObject, and one for CObject (AObject is the state of the tree, namely, what BObjects and what CObjects are selected for a particular AObject).
The tree should allow me:
1. for BObject type of nodes: a) a check box to add this particular BObject to the AObject that the currently showing tree is for. b) some way to expand and collaps the BObject nodes so that I can see what CObjects this particular BObject has, and c) a caption that identifies this particular BObject
2. for CObject type of nodes: a) I need to see a check box that allows me to add/remove this particular CObject to its parent BObject, and b) a caption for this particular CObject
I am afraid that the com.vaadin.ui.Tree will not allow me to show the checkboxes?!?! I can perhaps show one of [x|o] next to node captions alternating, but, it is a workaround and not the real deal. Anyone has an idea how I can do this?
Thanks in advance and pardon me if the explanation is a little too extensive.
There's basically three ways to have a tree with checkboxes and such.
If you want to stick to plain Tree, you can use an ItemStyleGenerator together with some style rules that include images of fake checkboxes, as is done in this example.
Or, just use TreeTable, in which you can have components in the columns.
With Grid, that gets double-difficult. You'd need to use one of the hierarchical solutions for Grid (there's some add-ons and other examples). Then, you'd need to have a proper kind of custom renderer for the checkboxes; I'm not sure if such exists already. So, there's quite a lot of work with that.