Hi everyone!
Would appreciate your help with the following:
I have a function defined in advanced propreties of a screen
function checkCountryName (name) {
...
}
Then I call this function in Extended Properties (onclick) of a button. I want to pass a variable from the screen to the function. How can I do it?
Thank you
Yeah, the on click action is called by the button's on click. So you probably need to have a hidden button that's clicked from the first button's on click, the first button doing the refresh and the hidden butten than calling the on click action (or your JavaScript).
Hello
You can refer to below threds that might help you
I hope this helps
Best Regards
Tousif Khan
You can do that by injecting into the call of the JavaScript inside the extended properties, the value of the variable. Something like:
"checkCountryName(" + myLocalVariable + ")"
There's one big caveat though, and that's that the expression is evaluated right after the Preperation has run, so if the variable must be dynamic (i.e. you change its value in your screen), you need to refresh the button after you change the value.
Thank you, I refreshed the button in OnClick Action of this button, but I guess the Script runs even before the OnClick Action
Thank you, Kilian. I created two different buttons just to test it. One button does the refresh and the other is calling javascript. For some reason it didn't work either for me.
In Reactive it's so much easier...
Wel, better find out the reason :). Check the console for errors, and debug to see that the buttons are called in the right sequence.
I will :) Thank you for the help
You're welcome, hope you can make it work.