cancel
Showing results for 
Search instead for 
Did you mean: 

where to programmatically swich screen ? In view or in presenter ?

LVers.1
Associate III

From my understanding, in the MVP model implemented by touchGfx, the view is intended to manage the UI element of a screen while the presenter is intented to manager the logic running in background (for instance hiding/showing elements based on information received from the model).

My question is: where should we put the calls to GotoxxxScreen() ? If i follow my understanding, i would put it in the presenter (or eventually in the model), but if i look at the various example as well as the calls implemented by touchGfx Designer, they are put in the view.

Moreover the view have a shortcut to the application() while the presenter must go through static_cast<FrontendApplication*>(Application::getInstance())

So i'm a bit lost on where is the best/advised place to programatically switch screens.

Thanks,

Laurent

1 ACCEPTED SOLUTION
3 REPLIES 3
LVers.1
Associate III

Thanks a lot for your reply. This is indeed how i did. Implementing the calls to "static_cast<FrontendApplication*>(Application::getInstance())->gotoXxxScreenNoTransition();' from within the various presenters.

GBert.2
Senior

No problem.

Sharing is caring.