2025-06-26 5:18 AM
I'm having a Model that receives data from the backend. I need that, according to the data received, independently of what view you're in, the presenter of the view executes a function that goes to a specific view.
For instance, I'm receiving 1 in the Model, weathever the view I'm in, there will be a function in the Presenter that recieves the 1 and knows that it has to change view to the appropriate one.
My function that maps the input to the view I've to change to is always the same, so I'm trying to avoid copying the whole logic in every presenter and just implement a single function that calls the bigger function that manages the logic.
The idea is to create a singleton class in the common folder and use it. I was just wondering if this behavior could be achieved in some way with FrontendApplication.cpp
Solved! Go to Solution.
2025-06-27 4:10 AM
If you create a screen via designer, the goto()-function is not automatically created.
To create the goto()-function for your "Service" screen in FrontendApplicationBase you need to
implement an interaction via designer where a screen change is triggered.
You could do something like this:
2025-06-27 2:12 AM
FrontendApplication& application = *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
application.gotoXYZScreenNoTransition();
2025-06-27 3:56 AM
Hi @MBrau.7
for some reason, even if the view has been created with a name "service" the application().gotoserviceScreenNoTransition(); doesn't work as the code is not correctly generated in the FrontendApplicationBase
2025-06-27 4:10 AM
If you create a screen via designer, the goto()-function is not automatically created.
To create the goto()-function for your "Service" screen in FrontendApplicationBase you need to
implement an interaction via designer where a screen change is triggered.
You could do something like this:
2025-06-27 4:28 AM
Ah, it makes sense. I thought it would automatically generate it based on the view you created
Thanks