Espace variable on Javascript

Espace variable on Javascript


How do i use a variable from a webscreen in the javascript editor of the extended properties?

I want to export a value from a javascript function to a variable from the webscreen

Thank you
Hi Pedro,

I'll explain both directions.

To pass a value from javascript onto a webscreen variable you'll need to put this value in a hidden field associated with this variable. Then you'll need to post the page back to the server so that the value binds with the variable. Another option would be the bind with an input parameter and passing the value in the url (on a link for example).

To do the opposite, i.e., put a value from a webscreen variable or input parameter onto the javascript you have several options. If the javascript code you want to run is associated with an even - the click of a button for instance - then you can define the javascript function in the webscreen javascript so that it has a parameter which will be the value you want to pass. After this, on the object you want to code the event add an extended property for the onclick event an call the javascript function with the variable's value, something like:
"myjavascriptfunction('" + eSpaceVariable + "');"

Hope this helps,
I found a easier solution in other topic, still i understood the explanation.
Thank you
What if I want to pass an object from javascript to the espace? The field does not take objects.