cancel
Showing results for 
Search instead for 
Did you mean: 

Throw POPUP TO CONFIRM and interrup execution

former_member189690
Participant
0 Kudos

Hi gyus, another challenge for community!

I've a button to do some actions but I want to show a confirmation popup before. If user clicks button Yes the execution should go on, but if user clicks No the execution should be interrupted.

An example:

ONACTIONSAVE

  • Throw popup

  • If YES

  • save_data()

  • else.

  • stop.

  • endif.

Thanks

Edited by: vanbelal on Mar 26, 2010 12:42 PM

Edited by: vanbelal on Mar 26, 2010 12:43 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

here is your clue:

a) create a popup in your action method onactionsave by using method of if_wd_window_manager "create_popup_to_confirm"

of type OK, CANCEL.

b) then create event handlers for OK, Cancel by using method of subscribe_to_button_event of interface if_Wd_window, you will get window referecne as returning param as a result of the pop up created in first step.

Write only this much of code in this method.

Now in the event handler method if OK write all you code for save.

for cancel dont write any code.

This is it.

Hope this helps

Regards

Manas Dua

former_member189690
Participant
0 Kudos

Cool Manas!

Sometimes I make life difficult for oneself...

Thank you!

former_member189690
Participant
0 Kudos

Hi again,

I want to show a window with an input field and a button to save the value on a variable.

The problem is I can't interrup general flow execution until user press the button 'Ok' for example.

I can't do that with CREATE_POPUP_TO_CONFIRM method, and if I use CREATE_WINDOW the execution doesn't stop.

An example step by step that I want to do:

1) User press button 'Reject'

2) Throw confirm popup Yes, No (on YES event I have implemented source code to do the changes)

3) If Yes => I have to show another kind of popup asking for a value 'Reason for rejection' input field and 'Save' button or similar.

4) Continue flow of 'Reject' button

Thank you guys!

Answers (1)

Answers (1)

former_member189690
Participant
0 Kudos

Reopened question for new requirements.

Thank you

Edited by: vanbelal on Apr 6, 2010 11:04 AM

Former Member
0 Kudos

Hi

In my opinion, throwing a pop up after pop up is not a good UI design.

Can't you try create your own custom window with input field and OK, CANCEL button inside the view and then launch this view from your original view.

So your window could be like this:

Are you sure you want to Reject?

If Yes, then please enter the reason for rejection: _________________

OK, CANCEL

In your pop up view you can define events for OK, CANCEL and code your functionality there.

Regards

Manas Dua

former_member189690
Participant
0 Kudos

Ok, I will try this solution.

How can I close the popup window when user press Cancel button?

Thank you Manas!

Former Member
0 Kudos

Try one of the solutions mentioned in the following thread:

Regards

Manas Dua

former_member189690
Participant
0 Kudos

thanks, solved problem!

Edited by: vanbelal on Apr 22, 2010 9:07 AM