Skip to main content
Professional
Associate III
March 5, 2019
Solved

Is it possible to launch a view from model whatever is the current view

  • March 5, 2019
  • 3 replies
  • 809 views

Hello, i had no response to that question

How to go to a view from Model without using modelListenner

to go to a view i call a virtual function from modelListenner DISPLAY_MYVIEW that do a call to presenters, and then to views (that then do application().gotoMyView(); )

I want to display the MyView screen with a call from the model (on an external event; whatever is the screen currently shown)

For that i don't want to call a virtual function from modelListenner: it would mean that have to define in each view and presenter the function DISPLAY_MYVIEW.

Is it possible ?

thanks for any support

best regards

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi @Professional​,

Sorry, i've been traveling and haven't had the time to catch up fully yet.

Sending messages to presenters and changing screens (showing a different view) are two different things. You can display any view you want by calling the generated goto methods (by designer) on the Application class.

e.g. from model:

static_cast<FrontendApplication*>(Application::getInstance())->gotoMyScreen();

3 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
March 5, 2019

Hi @Professional​,

Sorry, i've been traveling and haven't had the time to catch up fully yet.

Sending messages to presenters and changing screens (showing a different view) are two different things. You can display any view you want by calling the generated goto methods (by designer) on the Application class.

e.g. from model:

static_cast<FrontendApplication*>(Application::getInstance())->gotoMyScreen();

Professional
Associate III
March 5, 2019

Thanks a lot for the support

Martin KJELDSEN
Principal III
March 6, 2019

You're very welcome!