Event Outsystems 11 webblock synchronous or asynchronous?

Hello,


Correct me if I'm wrong, but triggering Events inside webblocks is "asynchronous" right?


Ff that is correct, is there a way to make it "synchronous"?


I have a simple problem where I need to get the a list of results from the webblock before the user clicks the "Save button".


It seems like there is a time where the sending of data from webblock to the screen does not finish before the user clicks the save button, which saves the old data instead of the newly updated one.


I'm thinking of putting the "fetching of data from the webblock to the save button"


So basically  fetch the data from the webblocks before I save. I plan to use the Event system of Outsystems 11, but if the triggering of events is "asynchronous" then this plan will not work.


Cheers.

Hi Josef,

I am assuming you are using traditional web app. 

You can pass id of your button to the web block and when you do any change in web block (like onkeypress extended event of input) you can disable/ hide your button (with the help of button id you have passed) using javascript. Javascript code can be like below

<script>
document.getElementById('"+ButtonId+"').disabled = true;
</script>

In you event handler on screen after you assign the date to local variable use runjavascript server action from HTTPRequestHandler ext to enable the button using same javascript above with .disables = false

I haven't tried it myself but I think this should work

Hello, 


It seems like Triggering Events are "Synchronous".

My problem is solved.


Cheers.

Hi Josef,

Yes you are right events are synchronous but there are cases this issue still occurs. 

So it will be good if you can share your solution here so that others searching for same issue can get help from your solution.