Screen flows

  

Hi, I'am new in Outsystems mobile apps development, I have a question :

Say i have mobile apps with screens below :

1. login screen

1.1 activity1 screen

1.2 activity2 screen

1.3 activity3 screen

I use the apps in mobile device with screen steps : 1 -> 1.1 -> 1.2 -> 1.3 -> 1.2. 

When I press back button in mobile device, the screen will go back like this : 1.2 -> 1.3 -> 1.2 -> 1.1 -> 1 -> exit apps.

I want my apps screen to move like this when i press back button in mobile device : 1.2 -> 1 -> exit apps.

How can I achieve that ? 

Thank you..





Welcome Phillip,

Let me give you some tips:

First you have to reference the System Action: "ScreenReachedFromHistory". If you don't have it referenced in your eSpace, go to Manage dependencies and check that in the System producer.

Then go to screen 1.3 and create an OnInitialize event handler there. Place the ScreenReachedFromHistory plus an if to check if that screen is being loaded due to a back navigation. If thats the case place a destination node (to 1).

Let me know if you understood

João Neves wrote:

Welcome Phillip,

Let me give you some tips:

First you have to reference the System Action: "ScreenReachedFromHistory". If you don't have it referenced in your eSpace, go to Manage dependencies and check that in the System producer.

Then go to screen 1.3 and create an OnInitialize event handler there. Place the ScreenReachedFromHistory plus an if to check if that screen is being loaded due to a back navigation. If thats the case place a destination node (to 1).

Let me know if you understood

Hi,

I have follow your steps, but i receive an error : OutSystems.Internal.Builtin.SystemActions.screenReachedFromHistory is not a function. Is there something that I missed ?



Not you, but we missed. Well looks like that System Action is not ok. Sorry for that.


As an alternative you can use our JS public API. Check out here:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Navigation#navigatedfromhistory

João Neves wrote:

Not you, but we missed. Well looks like that System Action is not ok. Sorry for that.


As an alternative you can use our JS public API. Check out here:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Navigation#navigatedfromhistory

I put in OnInitialize event handler, a javascript,  to use $public.Navigation.navigatedFromHistory(), but when I publish it, there an error said that "Public JS API Not Supported".  How can I make Public JS API available to my mobile apps?

To make sure the problem, i attach my sample oml. 

Thank you in advance


It means you're using Platform Server version 10.0.105. You need version 10.0.200 or later.

Sorry for the late response, yes after upgraded to new version it has no error on compiling. 

Thank you