cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a back button between windows, instead of reset

AEpif.1
Associate

Tell me, can I make a button to return to the previous window with data saving?

3 REPLIES 3
AEpif.1
Associate

I need your help

Alexandre RENOUX
Principal

Hello,

Each screen has a different context and when you switch, all the information from the previous screen is lost.

To solve this, you have the model (Model.cpp) where you can save data in, and you will be able to retrieve it between Screens. You will have to go through the Presenters to set and get variables in the Model from your ScreenView.

Please have a look at the following articles to better understand how TouchGFX works :

https://support.touchgfx.com/docs/development/ui-development/software-architecture/model-view-presenter-design-pattern

https://support.touchgfx.com/docs/development/ui-development/software-architecture/screen-definition-and-mvp/

https://support.touchgfx.com/docs/development/ui-development/software-architecture/code-structure/

And the best part is that you can find a tutorial that explains how to switch between screens and save data in the Model 😉 https://support.touchgfx.com/docs/tutorials/tutorial-03#step-2-saving-data

/Alexandre

Martin KJELDSEN
Chief III

Try looking through this forum to see if you can find a project i shared that keeps a stack of pointers to previous windows. This allows you to go "back", in the real sense of the word.