You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is about DX, but I would consider it a bug rather than a feature. TreeData and TreeGrid are Vaadin-provided classes. I feel I should not need to learn about DataCommunicator or that internally the TreeData is wrapped with some HierarchicalDataProvider or such. I should be able to manipulate the TreeData and see the results.
As a bare minimum, this would need to be documented very thoroughly, including how to avoid scrolling or "jumping" when updating.
Expected behavior
Dragging and dropping should not only have an effect in the TreeData, I should immediately see those changes.
Why do you use DataCommunicator? Isn't call the treeGrid.getDataProvider().refreshAll() be enough, that's a true public API for the component.
Would be good to update the documentation (and javadocs) to mention that the data refresh is needed in this case:
some methods in TreeData, e.g. setParent, have an instruction to call the TreeDataProvider#refreshAll(), but the above methods, used in the example, do not. Thus, we have to update the javadoc for all the method in TreeData at least, then online docs.
Or, put differently, where in the documentation does it say HierarchicalDataProvider<T, SerializablePredicate<T>> getDataProvider()
is the official API? It looks convoluted enough.
As I initially said (and the code has no getDataProvider() and has getDataComminicator() commented out) -- I feel one should not have to learn about the internal workings.
A am setting a TreeData, not a DataProvider of any kind. Getting one DataProvider and notifying it that I changed the TreeData seems like really bad API. In fact, TreeData is a Vaadin class and should already have all the means to update the representation when the model is changed.
If it is true that some methods in TreeData correctly notify the DataProvider that's wrapped around it, then all the data-altering methods should correctly notify the DataProvider about the change.
Description of the bug
This is about DX, but I would consider it a bug rather than a feature. TreeData and TreeGrid are Vaadin-provided classes. I feel I should not need to learn about DataCommunicator or that internally the TreeData is wrapped with some HierarchicalDataProvider or such. I should be able to manipulate the TreeData and see the results.
As a bare minimum, this would need to be documented very thoroughly, including how to avoid scrolling or "jumping" when updating.
Expected behavior
Dragging and dropping should not only have an effect in the TreeData, I should immediately see those changes.
Minimal reproducible example
package org.vaadin.example;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.grid.dnd.GridDropLocation;
import com.vaadin.flow.component.grid.dnd.GridDropMode;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.treegrid.TreeGrid;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.data.provider.hierarchy.TreeData;
import com.vaadin.flow.router.Route;
import java.util.ArrayList;
import java.util.List;
@route
public class MainView extends VerticalLayout {
}
Versions
The text was updated successfully, but these errors were encountered: