Hidden button cannot be accessed via Javascript on Mobile App?

Hidden button cannot be accessed via Javascript on Mobile App?

  

I have a mobile app with a button, so my Javascript code can access it's screen action via e.g: hiddenbutton.click();

It works when the button visible property set to True.

If I set visible property to False (either on button or enclosing container), it's like the button itself is never there...

On web app, even if button's visible is false, I still can access it using document.getElementById(buttonId).click();


Please help, thanks in advance...

Edit:

Found a workaround using container and CSS...

Button's visible property set to True.

.hidden
{ 
  display: none
}

Hello Harlin,

Its true when your you set visible property false in mobile app then Javascript code cannot access that button but same can be accessible in web application.

I also face same problem 2-3 months before when I am developing mobile app in outsystem 10

You can do one thing, you set the property of the button to true when you page load or render then define the javscript on  "On Initialise"  where it will set or dynamically change the state of button from true to false.

Hi Rajat,

It's easier to use CSS "display: none", since the button is still there but not displayed.

Hi Harlin,


I'm glad you solved the how can I trigger a "click" problem, but I was wondering why would you need a hidden button to trigger the click on a mobile app. I know that pattern was used on web apps to have JavaScript calling server actions, but for mobile apps your javascript can directly call actions through the $actions object.


Cheers,

Miguel

Miguel Ventura wrote:

Hi Harlin,


I'm glad you solved the how can I trigger a "click" problem, but I was wondering why would you need a hidden button to trigger the click on a mobile app. I know that pattern was used on web apps to have JavaScript calling server actions, but for mobile apps your javascript can directly call actions through the $actions object.


Cheers,

Miguel

Hi, I use it on Google Maps Infowindow Javascript.

Can I access $actions object on Marker Event JavaScript?

I thought it only for JS node on Logic Flow.