Nicola
Nicola

Reputation: 297

Is it possible to pause execution when opening a popup in Genexus?

I was wondering if it is possible in web in genexus to open a popup in an event, wait for it to be closed and then continue executing the following code

Event 'popup'
    WReadFlag.Popup(&FLAG)
    msg("FLAG " + &FLAG)
Endevent

What happens at the moment is that the popup is opened and the rest of the code is executed immediately afterwards (in this case obviously ignoring the &Flag string that I insert into the popup since it has not yet been valorised)

I know how to handle this using the Web extensions tookit with the onPopupClosed command, but I'm wondering if there's a way to handle this more easily since in many cases it would lighten the work

Currently the project I work on is developed with Genexus 17U10, but the answer should not be limited to this, if a newer version has this or similar functionality, also considering the tools offered by WorkWithPlus

Upvotes: 0

Views: 62

Answers (1)

ealmeida
ealmeida

Reputation: 512

When displaying a popup, it will always continue executing the code that comes after it.

I suppose what you want to do is execute code after the popup, using the results entered by the user in the popup.

One possible solution is to move from:

WebPanel1.PopUp(&Flag)
ExecuteAfterPopup(&Flag)

to:

WebPanel1.PopUp()

and in the Enter event of the WebPanel, include:

// Read &Flag
ExecuteAfterPopup(&Flag)
return

This way, it will return and execute the same code.

It may happen that you're missing a value that you had in the original WebPanel, which you'll need to pass as a parameter to WebPanel1 or exchange through session variables.

Upvotes: 1

Related Questions