using a modal to update a variable in a screen action

This question is related to a web app written in OutSystems 11.

I have placed a modal in a web screen. It has the following 2 buttons:
Inside a screen action I do the following:


After the modal toggles on, the user clicks the yes or no button, which sets the Continue Pressed variable to True or False (it's default value is False), and toggles the modal off. Currently, as soon as the modal is toggled on, the screen action moves on to evaluate the ContinuePressed? if statement, and always follows the False path (that variables default value). How can I modify my program so I don't evaluate the if statement until the user presses a button on the modal?

Thanks for the help,

Ryan

Hi Ryan,

Did you read this document on how to code a modal in traditional web?

Regards,

Daniel

Solution

Hello Ryan,


Your code is not enough but let me guess.

The action you are showing the code is the action that OPENS the modal, right?
The ToggleModal just turns the Modal visible or not (depending on its actual state).
This means that it will just keep executing after that. The Modal is not a Popup.

So, what you have to do is to move the code you have AFTER the ToggleModal, to the actions you execute FROM the Modal (through the two buttons).

Cheers. 

Solution

Thank you for the multiple responses. It seems like the easiest thing to do will be to just put the code in the modal button (thanks Eduardo). However, assif_tiger's post has motivated me to learn more about web blocks and triggers.

Hsppy to know Ryan Rigby :)