What data from a grid items are sent to the client?

Is it only data specified in columns or is the whole item serialized and sent?

It depends; which part are we talking about?

I presume he’s asking whether the entire object representing an item is serialized and sent to the client.

E.g. if you have a Grid, the Person items might contain stuff like an SSN field which is not used in the Grid in anyway.

And the answer to that is no, the entire object is not serialized and sent to the browser.

But when used inside a lit template as object it can be send to the client, that’s why I was hesitant to say no :sweat_smile:

True, there are cases and cases

Regardless of built-in safety features in Vaadin, it is still strongly advised to use DTO’s especially when your data model contains sensitive data. I.e. use DTO’s as view specific objects which have only the properties needed and not containing the data will not be exposed to users. This will also reduce accidental tampering of the properties. Naturally the most extreme version of this would be to use immutable objects as DTOs.

@quirky-zebra Are you saying that the entire object is serialized and sent to the browser when using a lit template, even if you only specify a few properties?

That doesn’t seem to make sense, considering the whole withProperty pattern

No, only if you explicitly use an object there as return value

Ah got it

I am fine then, thanks all