How to display a confirmation message after checking in the servlet?

0

Good afternoon everyone! When I click the Change button, I check to see if the data in the database remains the same. How do I return a confirmation window if the results are not the same?

Example: I select the material I want to change, fill in the inputs, but before clicking Change, I leave the table for some reason, and another user on another computer changes this same material. When I go back and click Change, does the data check, how do I show a message stating that the data has changed and asking if I still want to change it?

Thanks in advance :)

    
asked by anonymous 13.11.2016 / 19:34

1 answer

0

You would have to save the current status of the object at the beginning of the transaction Ex:

When starting the change flow, you put the obj to be changed in json format in the view in a hidden something like this and then validate it again in the backend ...

If your object is saved has the date and time of the change, you can simply put this field as hidden and validate if it is the same as changed but in this way you will not know what has changed.

    
14.11.2016 / 12:56