Skip to main content
LVers.1
Associate III
November 16, 2021
Solved

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

  • November 16, 2021
  • 3 replies
  • 1449 views

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

This topic has been closed for replies.

3 replies

GBert.2
GBert.2Best answer
Senior
November 18, 2021
LVers.1
LVers.1Author
Associate III
November 19, 2021

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
November 19, 2021

No problem.

Sharing is caring.