cancel
Showing results for 
Search instead for 
Did you mean: 

Problem opening a popup after another popup

mh97
Contributor
0 Kudos

Hi,

I have some code that opens a popup using 'create_popup_to_confirm'. This code works fine if I put it on its own, say for example in wddomodifyview (for test purpose).

But, I want to call it during later processing of the view. In my design, previously the user has opened another popup (which uses a custom window) for value selection, and it is possible for the user to close that window without selecting a value. In wddomodifyview there is a check for whether the value is empty when it shouldn't be. If this check fails, the new popup should open (which checks whether the user wants to back out of this mode or go back and select a value).

(I realize that I could handle the empty selection before closing the first popup. I preferred not to change that component.)

Problem is, the same code that works fine when it is alone in wddomodifyview, doesn't open the popup when it runs after the other popup. In debugging I find that the condition is met (value was not selected when it should have been), and the code to create the popup runs, but the popup doesn't open.

Can anyone suggest what I might be doing wrong? Are there limitations in webdynpro regarding opening another popup after a first popup? Do I need to delete the window object after it's closed, or something like that?

Thanks for any help!

Margaret

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you maintained pop up window name .

i.e,

you need to assign the window name = pop up window name i.e,

if you are in window1 then if you want to open window2 while clicking on some record then you need to maintain window name = window2 in window1.

Warm Regards,

PavanKumar.G

Warm Regards,

PavanKumar.G

Answers (3)

Answers (3)

mh97
Contributor
0 Kudos

Thanks everyone for your replies, and apologies for my slow response.

I ended up changing the design so that the second call of a popup is not needed. I think this creates a cleaner user interface, so there's no need for me to pursue this issue at the moment. However, in the process of trying to address it I tried implementing a set of SAP notes, and found that we have an issue with the portal theme version not matching the ur version in the backend. This was causing a javascript error when the second popup was called. (I managed to omit that in my original post here. Kind of a major omission.) For those interested in the relevant notes, search for "Corrections for unified rendering" in the support portal. The key note is 1411980 which is a general note that identifies the theme version as a potential issue. Anyway our portal admin is looking into correcting that, but I've changed the app so that the problem isn't occurring anyway.

PavanKumar - yes, I did maintain the window name.

Lekha and Kalyan - My original post wasn't clear on this. I only had the second popup running from wddomodifyview because it didn't work when I put it where I thought it should be. The original design had a subscribed event from the first popup, and in that event handler if a value wasn't chosen it was supposed to open the second popup. Since I've designed out the second popup now, it is no longer an issue. But, thank you for confirming that it was correct to put it in the event handler as I did initially. I'm sure once we get the javascript issue resolved this should work fine.

I have one question remaining (it's 'academic' at this time, but I might need it later): if my first popup is a custom view that has custom buttions (not in the fixed values of WDR_POPUP_BUTTON), how do I subscribe to the event? IF_WD_WINDOW->SUBSCRIBE_TO_BUTTON_EVENT( ) requires import parameter BUTTON with type of WDR_POPUP_BUTTON. Is it possible to subscribe to a button on another view that isn't in WDR_POPUP_BUTTON?

Thanks again for your time and suggestions,

Margaret

Former Member
0 Kudos

Hi,

We can subscribe to the button in this popup this way -

First create a Action ex: YES in your actions tab of that view....Now you need to pass this action name to theACTION_NAME of SUBSCRIBE TO BUTTON EVENT method and also the view reference to this param ACTION_VIEW...we can get the view reference usign the code wizard method WD_GET_API...

Question of calling another action of other view - In that case you should have the reference of that view as the action is present in that view. In that case we dont use the POPUP TO CONFIRM method to open that view.. then place this view in other window

we can use CREATE_WINDOW of if_wd_window_manager and pass the other window name to this method.

Regards,

Lekha.

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Margaret

Instead of writing the check condition in the wdModify method use event handling mechanism, when ever a user selects or closes trigger a event, so this event must be handled in a separate handler where you can write your logic for check and

open the confirmation popup with suitable information to the user. Better to close the custom window popup.

You can also use a confirmation dialogue to confirm whether user s selected some data or not.

I hope this information will help you

Regards

KALYAN

Former Member
0 Kudos

Can you check one thing - Create a button and use the same code that you have written in MODIFYVIEW..and comment the same in MOIDFYVIEw for testing purpose. I didnt test that opening a popup from other popup in MODIFYVIEW regarding the behaviour.

what is the requirement that you have written it in MODIFYVIEW..

Edited by: Lekha on Dec 19, 2011 11:53 AM