Hi, I need a block that triggers an event when the internet status changes offline/online.
I´m Trying to use the Outsystems UI Block "NetworkStatusChanged" but when i test it and shutdown my connection, enters in loop, refreshing my offline screen and sending and exception "Request Failed with an error".
This block was suposed to just trigger when the status change, as it says in description, but at my app, when is online everything is good, when is offline i cant understand what is happening.
Here's the logic I implemented to handle the event:
the second if, is a boolean variable to control the flow.
Thanks for your help,
Pedro Rocha
Hello @Pedro Rocha
The issue is on the logic of your application and not on the NetworkStatusChanged block.
You caused an infinite loop by not initializing your local variable Online.
To prevent this, you do the following:
Hope it helps!
Cheers,GM
Can you please share an oml where we can reproduce the same use case, just to avoid back and forward conversations?
I just did a quick test and is working as intended:
Hi Gonçalo,
Here is a simple app, with the loop.
It Worked,
Thanks Gonçalo!!
Hi,
Try this component: Client Awaitable Popups - Offline (demo), the module expose an action WaitUntilOnline that block the flow until the network is available.
However, I've never test the component in a mobile scenario.