cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding POPup window closing.

Former Member
0 Kudos

hi,

I have Two DCs-DC1 and DC2.

Now i have called the dc1 in dc2.actually dc2 is the main dc.Now i have a cancel button in view in

dc1 which is used to close up a popup window.This popup should come in dc2.I have done all the steps to call this view from dc1 to dc2.but this cancel is not working.

I have done thje following steps to make this cancel button work.

1)i have created an event in the interface controler of dc1and a method to fire this event.i have written th folowing codes

public void fireprcupdateevent( )

{

//@@begin fireprcupdateevent()

wdThis.wdFireEventPrcupdateevent();

wdComponentAPI.getMessageManager().reportSuccess("success2");

//@@end

2)I am calling this controller in that view.

public void onActioncancel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActioncancel(ServerEvent)

wdThis.wdGetC_PRCoutcomeInterfaceController().fireprcupdateevent();

wdComponentAPI.getMessageManager().reportSuccess("success1");

//@@end

}

Inn dc2:

1)I have created an event handler and wrtten this code:

*IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("W_PRCAction_popup");*

** IWDWindow window1 = wdThis.wdGetContext().createVn_popup_createprcElement().getVa_WindowInstance_updateprc();**

** window1.destroy();**

* *

Now iam unable to track the the problem as why this cancel button not performing the closing action.

Now the problem is itsi not showing any error but that cancel button is not working.if we click on it it will not close.

plz help

Edited by: Nisha Nair on Jan 23, 2008 8:16 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nisha,

Use the same window instance available in the context instead of again using

" IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("W_PRCAction_popup"); " while destroying the instance.

regards

Sumit

Former Member
0 Kudos

plz explain in detail about the window instance

Former Member
0 Kudos

Hi Nisha,

Create a context attribute of type com.sap.tc.webdynpro.services.session.api.IWDWindow

Ex: windowHandle

Store the window instance created in this context

Ex:

IWDWindowInfo modelWindowInfo = wdThis.wdGetAPI().getComponent().getComponentInfo().findInWindows(windowName);

IWDWindow modelWindow = windowManager.createModalWindow(modelWindowInfo);

Store the modelWindow instance in the above create context attribute.

wdContext.currentContextElement().setWindowHandle(modelWindow);

When you click the close button get the window handle from the context attribute and call the close or destroy instance.

Ex:

IWDWindow window = wdContext.currentContextElement().getWindowHandle();

window.close();

window.distroyInstance();

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Nisha,

When u create a window instance to open a popup from some view, store that instance in the context , map that to component controller & in the popup view map ur window instance to the component controller. In popup access that window instance & destroy it.

regards

Sumit