[Mobile Utilities] Disable Back Button doesn't work the second time

[Mobile Utilities] Disable Back Button doesn't work the second time

  
Forge Component
(10)
Published on 2 Jun by Miguel Vicente
10 votes
Published on 2 Jun by Miguel Vicente

Hi,

I was trying the Mobile Utilities Demo App eSpace, and testing the Cordova disable back button action. It seems to work fine the first time you use it but if you disable -> enable -> disable, it doesn't work anymore... any reason why?

Tried to remove the event listener before adding a new one but it did not work...

Thanks

Hi Luis,

How are you? 

About that use case can you tell me what you are trying to accomplish? 

Do you want to have one page to disable and then other page that have the back button enable? 

Let me know you use case to better help you.

Thank you,

Kind Regards,

Miguel Vicente

Miguel Vicente wrote:

Hi Luis,

How are you? 

About that use case can you tell me what you are trying to accomplish? 

Do you want to have one page to disable and then other page that have the back button enable? 

Let me know you use case to better help you.

Thank you,

Kind Regards,

Miguel Vicente

Imagine you have a flow made of 3 screens to register a client and you want them to be able to go back from screen 3 to screen 2 and from screen 2 to screen 1. But you don't want them to go back from screen 1 to wherever they were before, for example homepage. So you need to disable and enable the back button on different screens.

In the Demo App, if you click disable -> enable -> disable, the button will remain enable.

I've managed to find a solution, needing to add the listener to each event (and making 2 different events for enable and disable) on the OnReady actions, putting a JS Script to run on each screen with the handler function and removing the Event Listener in every option to move forward or backward in each screen...


@Luis

Tomorrow I will lunch a new version with some fixes and then I will send you an example with your use case. I was testing some of the functions and I'm fixing some issues. 

Sorry for this situation.

Kind Regards,

Miguel Vicente

@Luis

You have an example to do that here.

https://www.outsystems.com/forge/component/1805/exit-on-back/?(not.licensed.for.production)=

Until we review this situation.

Thank you,

Kind Regards

Miguel Vicente