cancel
Showing results for 
Search instead for 
Did you mean: 

Periodic update of container content

jimmii
Senior II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Alexandre RENOUX
Principal

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

View solution in original post

2 REPLIES 2
Alexandre RENOUX
Principal

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

HI @Alexandre RENOUX​ 

Thanks. That's what I imagined.

/jimmii