cancel
Showing results for 
Search instead for 
Did you mean: 

Stop execution of script when Messagebox opens.

Former Member
0 Kudos

I have a confirm MessageBox in my page. I what to execute a function on click of "yes" and other function on click of "Cancel" and there are other lines below the messagebox. When message box opens, the line below it executes.

I want to execute the lines below messagebox after the function of yes or cancel (as it is in javascript confirm function).

How can I achieve this or is there some other control for this kind of operation?

JSBin.

Thanks,

Shashi

Accepted Solutions (0)

Answers (1)

Answers (1)

Qualiture
Active Contributor
0 Kudos

According to the API, the UI5 MessageBox is event-driven so the behavior you're after is not possible.

Just make sure there is no code after you open the MessageBox, and only in de success/cancel event handlers. That way you have the same behavior.

Former Member
0 Kudos

Thank you for clarifying.

So, it cannot be done sapui5. I assume plugin is the only way.

Qualiture
Active Contributor
0 Kudos

It cannot be done in UI5, which is a good thing. I believe it's actually bad programming to have execution halted by a message box...

A much much much better approach is to write the success/cancel code in the respective event handlers