Hi Vaadin community!
I have a question on AutoCrud.
AutoCrud is a great component to display and edit data. I use it like so:
<AutoCrud
service={DocumentService}
model={DocumentDtoModel}
gridProps={{
...
}}
formProps={{
...
}}
/>
Is it possible to somehow pass a parameter to the service mentioned in the AutoCrud component. For Grids, I do something like this:
const myParameter = useSignal<String>("");
const documentDataProvider = useGridDataProvider(
async (pageable) => DocumentService.listDocuments(pageable, myParameter.value.valueOf()),
// Providing the search term as a dependency will automatically
// refresh the data provider when the search term changes
[myParameter.value]
);
return (
<Grid dataProvider={documentDataProvider}>
<GridSortColumn path="name" />
<GridSortColumn path="description" />
</Grid>
);
Can I do something similar in AutoCrud?
Why would I need this? I would like to show only specific items in the AutoCrud (e.g. all Documents belonging to a certain person in the overview of that person).
Thanks for your help!