Mobile- Using events to change container visibility depending on Bluetooth status

Mobile- Using events to change container visibility depending on Bluetooth status

  

Hello everyone,

I'm currently developing an app and I have some Bluetooth methods available for me for enabling, searching, and connecting to Bluetooth devices.

I'm currently trying to set the visibility of a container to change depending on whether or not Bluetooth is connected and was wondering the best way to go about this.

What I'm trying to do:
I want the app to enable Bluetooth on the device in case it is off. Right now I'm using OnInitialize to set variables related to the Bluetooth functionality and container visibility. But I'm running into problems now because when I set a variable to TRUE for container visibility (in OnReady) , its not reflected in the DOM. I've also tried this in the OnRender method to no avail.

Any tips are appreciated.

Ala

Hi Ala,

In Mobile Apps, when a Variable that is bound to a Screen Widget changes its value, the Screen Widget is refreshed using that new value. If you say "it is not reflected in the DOM", I assume you mean that changing the Variable's value does not re-evaluate the Expression it's used in (or the visibility of the Container)? Can you share an eSpace that exhibits this behaviour?

Kilian Hekhuis wrote:

Hi Ala,

In Mobile Apps, when a Variable that is bound to a Screen Widget changes its value, the Screen Widget is refreshed using that new value. If you say "it is not reflected in the DOM", I assume you mean that changing the Variable's value does not re-evaluate the Expression it's used in (or the visibility of the Container)? Can you share an eSpace that exhibits this behaviour?

You assume correct! However, I changed my strategy and fixed the problem by creating a separate block to encapsulate the logic and didn't need to rely on the container anymore.
Thanks anyways! Appreciate the input.
Ala