Local commits and rollbacks for persistent objects - Mendix Forum

Local commits and rollbacks for persistent objects

1

Essentially I would like a [Cancel] button that works as expected in the edit flow of an uncommitted object.

 

Imagine creating an order as a user. We add orderlines by pressing the [Add] button and filling in our data in the popups that appear. We are just about to save our order until we consider changing the quantity of an orderline. We open it, adjust the quantity from 10 to 100.. but then we realize we don't really need that much so we press [Cancel]..

 

As a user we expect the quantityline to "just” go back to 10, but as a developer this scenario is strangely annoying;

 

What is my ideal solution?

Give persistent entities access to the same “local” commit and rollback mechanisms as non-persistent entities!

 

User [Add]'s an object but it should not be committed to the database yet? Local commit.

User [Cancel]'s editing an object after making changes? Local rollback.

 

These scenario's are quite common, making [Cancel] buttons should not be so hard and the mechanism to fix it already exists.. it just needs to be made available for persistent entities!

asked
0 answers