I have the requirement to dynamically enable/disable CRUD operations depending on the data. Example: a closed contract cannot be deleted. I would like to manage this in the frontend and not later in the backend or even in the database. My idea was to add another item click listener to the grid managing the crud header actions, for example:
Works fine, however, if editing the object is still allowed there is a problem on edit because the itemClickEvent is no more raised and after the update transaction finishes the delete button becomes active.
Any idea for a better solution? It would be nice if we could access the header objects from a custom form factory because buildNewForm is IMO the place where the form dynamic occurs. It's a bit confusing that the action buttons Save and Cancel are part of the form and instantiated by the form factory and the action buttons Add, Delete and Edit are part of the crud package. IMO all the actions belong to business logic and should be accessible from the same logical unit, ether crud or form.
I have the requirement to dynamically enable/disable CRUD operations depending on the data. Example: a closed contract cannot be deleted. I would like to manage this in the frontend and not later in the backend or even in the database. My idea was to add another item click listener to the grid managing the crud header actions, for example:
Works fine, however, if editing the object is still allowed there is a problem on edit because the itemClickEvent is no more raised and after the update transaction finishes the delete button becomes active.
Any idea for a better solution? It would be nice if we could access the header objects from a custom form factory because
buildNewForm
is IMO the place where the form dynamic occurs. It's a bit confusing that the action buttons Save and Cancel are part of the form and instantiated by the form factory and the action buttons Add, Delete and Edit are part of the crud package. IMO all the actions belong to business logic and should be accessible from the same logical unit, ether crud or form.