Check if entity is being edited already

Hello,

I want to be able to use an entity’s editor screen for view only if it is being edited somewhere else.

What I did so far was store a flag in my database that gets updated when the first editor screen is opened so that any others opened after that cannot be edited. I use a BeforeCloseEvent to change the flag back to allow the entity to be opened for editing again. The problem with this is if a user closes their browser with the editing screen opened, the flag never resets and locks the entity into view only. Is there any way to detect if the user is closing their browser?

Thanks,
Chris Krozel

Hi,

This functionality is covered already by the CUBA locking feature. You can read more about it here:

Concurrent Usage prevention with Locks – Road to CUBA and beyond...

Bye
Mario

2 Likes

Hello,

Sorry I missed that somehow, this is what I needed

Thanks,
Chris Krozel