Skip to main content
Dejan Nedeljkovic
Associate III
September 16, 2019
Solved

Change the Screen from Container

  • September 16, 2019
  • 8 replies
  • 1550 views

Hi

I have a container (menuScreen) with some buttons in it and I want to change to a screenview depending on the buttons. I'm accesing this container (menuScreen) from another container that is added in every screen in the designer.

Is it possible to change to a screen from this container (menuScreen)?

Regards

Dejan

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

Hi @Dejan Nedeljkovic​,

Sure. Just configure the container to take a callback with a handler that you define in your views. In that handler, since you are now in the view, you can then transition directly to another screen or maybe go through the presenter or however you want to do that.

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

/Martin

8 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
September 16, 2019

Hi @Dejan Nedeljkovic​,

Sure. Just configure the container to take a callback with a handler that you define in your views. In that handler, since you are now in the view, you can then transition directly to another screen or maybe go through the presenter or however you want to do that.

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

/Martin

eng23
Senior
September 17, 2019

Hi @Martin KJELDSEN​ 

In one of my screen transitions I have default handler.

If I'm in my TopSlideMenu and goto to other screen and after I want to go back to home screen I have default handler. My "goto's" I did in two ways, both I have the same:

application().gotoScreen_HomeScreenNoTransition();
or
static_cast<FrontendApplication*>Application::getInstance())->gotoScreen_HomeScreenNoTransition();

Any idea what is happening?

Regards.

Dejan Nedeljkovic
Associate III
September 16, 2019

Hi @Martin KJELDSEN​ 

Thanks for the fast response. I've jsut done it with a callback and then transition in the handler to another screen.

It's working how it should.

Now I'm having another problem, that the container ist not the foremost. The container is displaying behind textAreas.

How can I set the container to the front?

Regards

Dejan

Martin KJELDSEN
Principal III
September 16, 2019

Hi @Dejan Nedeljkovic​,

No problem. You can configure the z-order of widgets in the designer by simply dragging them up and down. In this application, the green box is the background (Furthest down in the widget tree).

0690X00000AREzxQAH.png

Dejan Nedeljkovic
Associate III
September 16, 2019

Thank you, that helped.

Regards

Dejan