cancel
Showing results for 
Search instead for 
Did you mean: 

Change the Screen from Container

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

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

8 REPLIES 8
Martin KJELDSEN
Chief III

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

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
Chief III

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

Thank you, that helped.

Regards

Dejan

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.

Hi @eng23​,

Sorry, but can you rephrase? i'm not sure i quite understand your issue. Thanks!

/Martin

Hi @Martin KJELDSEN​ 

Yes sorry I wasn't clear in my explanation.

Well I've implemented a TopSlideMenu in my home screen where I have a configuration icon. When I click on configuration icon I call another screen by this command:

application().gotoScreen_ConfigScreenSlideTransitionNorth();

In this new screen I added a Home Icon to go back to my home screen. When I click on this the code stops and go to Default Handler. The command in configuration screen:

application().gotoScreen_HomeScreenNoTransition();

I hope know it is understandable.

Regards.

Does this work in the simulator?