2020-02-24 06:59 AM
Hi,
I have a few views. On each view there is a container (date, time) which has to be updated periodically (every minute) with the new date/time. This container is the same on every view.
My idea is to go through the model with the modelListener. But this means that I have to implement the presenter method on every screen...
Is there a better way to do this? So that I have only one method in the container?
Thank for your help,
Cheers, /jimmii
Solved! Go to Solution.
2020-02-25 05:24 AM
Hi,
This has to be done the way you mentioned. TouchGFX framework is based on MVP (Model View Presenter) where you have one presenter per view. Therefore if you have functions in the model that needs to be called in the View, you have to go through implementing the function in its associated Presenter.
To avoid that you can have only one view instead. Therefore you will have only one Presenter that will implement the functions of the model. If many elements are shared among your views, it would be interesting to see if several views are relevant or if only updating the parts which are different is better.
/Alexandre
2020-02-25 05:24 AM
Hi,
This has to be done the way you mentioned. TouchGFX framework is based on MVP (Model View Presenter) where you have one presenter per view. Therefore if you have functions in the model that needs to be called in the View, you have to go through implementing the function in its associated Presenter.
To avoid that you can have only one view instead. Therefore you will have only one Presenter that will implement the functions of the model. If many elements are shared among your views, it would be interesting to see if several views are relevant or if only updating the parts which are different is better.
/Alexandre
2020-02-25 06:13 AM
HI @Alexandre RENOUX
Thanks. That's what I imagined.
/jimmii