Open nickza opened 7 years ago
addRow
in Vaadin Framework 7 was based on the old Container API where each row was an Item
that consisted of a set or Property
instances.
With the new data API in Vaadin Framework 8, the corresponding functionality would instead be in the form of addItem(T item)
that would take one single object that represents the entire row.
One issue with adding a generic addItem() is that not all data providers are modifiable. In fact, unlike the old Container API that tried to handle modifications often in a suboptimal way, the DataProvider API itself does not attempt to directly support such modifications nor notifying the component about modifications.
Simple in-memory data providers (ListDataProvider) could support such operations, but having the API on Grid might mislead users to believe that it always works.
I have the sample Problem. My Example: I have a grid that needs to be build on the fly. I cannot have a type on it. then I need to build the grid based on database response. The addItem does not appear on my Vaadin 8.0... The only thing related is addItemClickListener....
You should probably use/write a DataProvider that supports such an operation - that is much simpler with Vaadin 8 than writing a Vaadin 7 Container. You can also use a more generic type such as e.g. Map as the type of the rows of the Grid to be able to have an arbitrary set of values, though you'd also want to configure the columns so that the values are shown in a sensible way.
The method adding data to the data provider may need to call AbstractDataProvider.refreshAll().
@hesara I was thinking about this and I found Out I can achieve the same just by extending the TextRenderer.
Hello there!
It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe.
There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):
Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!
Vaadin 8.0.6 Grid missing addRow, in version 7 there was a way to addrow. Could this come back ?