Problem with creating View Page and Editing Page

1
Hello Community,   I have a View-Page where you can see specific data. This View-Page contains a Data-View as Data Container with Labels and Textboxses. The Datasource for the Data-View is Type of Context "Main.Design, from page parameter 'Design'".   Now I want to create an Edit-Page, where the user can edit the data. I created an "Edit-Button". By clicking on this button a new page will open. This page is basically a copy of the View-Page. Here, the user can change the data and by clicking on a "Safe-button" the new data will save in the database. Everything works fine, but my problem is this:   If the user changes the value in a text box and then clicks on the "Cancel" button, which closes the current page and returns to the "View page", this change is also displayed in the view page.  I have not yet found a solution to this problem, can anyone give me an approach?
asked
3 answers
1

What action does your Cancel button perform? It sounds like it using "Close page", but it should be using "Cancel changes" as this will roll back any changes the user may have made.

 

https://docs.mendix.com/refguide7/action-button/#events-properties

 

I hope this helps.

answered
0

Hey Robert,

 

thank u for your help.

 

I already tried to use the "Cancel changes" operation within my "Cancel-Button". The problem here is that it will close the "Edit-Page" and then it will show the "View-Page" but all Textbox-Values are empty. 

 

View-Page:

image.png

Assuming I have changed the name, but I change my decision and click on the "Cancel" button to go back cancel the change and to go back to "View-Page":

image.png

Now we can see that all textboxes are empty.

answered
0

Thank u Robert!

 

This was the problem. I was not commited before. Now its commited before i reache the edit page:)

 

Now it works fine.

answered