on 01-23-2008 6:31 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.