If you call a delete command from the context menu without a confirmation dialog with an executability rule that accesses the object to be deleted, this generates an error because the executability rule is evaluated again on the deleted object after deletion.
Analysis
Commands in the context menu are permanently bound to the object on which the context menu was opened. Although the execution of a command in the context menu closes the context menu, the browser window control delays closing it until the command has been finally validated. This means that all commands in the context menu remain registered in the command model registry until the final validation. If you are unlucky, the command model registry is validated in the final validation before the browser window control and evaluates the executability rules again on the now deleted object (which causes the crash).
Solution
When closing a popup dialog, it must be logged off immediately so that the commands contained in it are also logged off from the command model registry. Only the final removal from the UI can be delayed until the final validation of the browser window control.
Test
- Configure table with delete command on the rows.
- Switch off query for the delete command.
- Configure an executability rule for the delete command that decides whether it can be deleted or not, e.g. based on the name of the object.
- Execute the delete command via the context menu of the table.
- No error may occur due to access to a deleted object.