Webblock in Popup runs Preparation of again when "Cancel" button calls the PopupClose

I have a Popup that uses a webblock, this webblock has a JSON string that it compresses to send to the client for a specific function. The string is passed from the PopUp to the webblock, then the webblock compresses it in the preparation. 

On the Popup is an "Accept" and "Cancel" button (I am not going to discuss the function of the popup and webblock it is unnecessary detail), when the Accept or Cancel is clicked I call the Popup_Editor_Close to close the popup with a notification to the parent screen, but the Popup_Editor_Close results in the preparation being called again and therefore the JSON string is compressed again. The problem is this compression takes 1.2 seconds, so when the Accept/Cancel button is clicked the user waits for some time before the popup closes. This is not acceptable, it must close straight away. How can I prevent the preparation on the webblock to run again, and why would OutSystems run the preparation again on a screen that is being closed? All I can think is the mechanism of the Popup_Editor_Close causes a submit of the page refreshing it and then only gets the event to close, this is not acceptable, it causes all sorts of unexpected behavior. On the Cancel button only the Popup_Editor_Close is called, no notification, and still it calls the preparation again.

what is your action on the buttons?

i hope it is ajax-submit...


Hi Elize van der Riet,

PopUp _Editor_close never call preparation ,You must check your button method must be ajax submit .

If its still problem then you can upload your oml for immediate help.


THanks Rocky, I set the button to Ajax Submit and preparation is not called again.

Hey Elize van der Riet,

Please mark it as solution ,so  it will be helpful for other.