Hi ,
In container onclick, I have called the function which is defined in the screen javascript editor in traditional web app.
Is it possible to pass the output of the screen javascript to the local variable?
Hello,
Usually, we use a hidden input (placed in the OutSystems side) associated with a variable, and when we want to pass the value from JavaScript, we use JavaScript to set the input value.
When submitting, the variable in OutSystems will have the value.
Cheers.
Hi @Eduardo Jauch!I'm having the same issue. I'm assigning the value property of my input and I can even see on the browser console the value, but my local variable remains empty.
document.getElementsByClassName("json_DataHolder-CreateBoQ")[0].value=jsonString;
Any idea as to why this can happen?
Eduardo Jauch absolute right as usual!)
A bit more in detail, set hidden style for input and give name to it. Then use in your JS following statement: document.getElementById('"+Input.Id+"').value =YourValue.
If vice versa use the OutSystems variable in JS, then: var JSVar = '" + OutsystemsVar + "'.
Good luck!
It works, but with a delay. I need to pass the local variable to the database on form submit. Whenever, I change values (element on change) local variable only has the previous value from its associated input. So, every time I submit the form it inserts a previously appointed value into the database.
Are there any other ways to assign a javascript variable to a local variable?
I am struggling with this situation as well...