Jump to conversation
Unresolved conversations (0)
Nice work!

Nice work!

All of your conversations have been resolved.

Resolved conversations (1)
@sissbruecker sissbruecker Apr 26, 2022
I'm in general a bit puzzled about what's going on here, specifically why `TreeGrid` and `HierarchicalDataCommunicator` have their own logic for generating default keys. For `Grid`, `DataCommunicator` has a `KeyMapper` that generates an increasing number as unique key for each item. Also data communicator will ensure that key mapper gets cleaned up when data is removed. For `TreeGrid`, `HierarchicalDataCommunicator` requires you to provide a unique key provider. This key provider is then used in a custom key mapper that extends from `KeyMapper` and uses the unique key provider to generate keys. Now we change the unique key provider to use an increasing number as key - which is the same thing the regular `KeyMapper` would have done. Why aren't we just using the default `KeyMapper` in `HierarchicalDataCommunicator`? The benefit here would be that we don't need to keep two maps of keys (one in `KeyMapper`, and one in `TreeGrid`). And the map in `KeyMapper` actually gets cleaned up when data changes, while the one that is being introduced here would just keep growing.
...din/flow/component/treegrid/TreeGrid.java
sissbruecker mshabarov