on 04-03-2008 9:44 AM
Hi all
i want to pop up a confirmationDialogBox on date selection in a DateNavigator
so in actionhandler onDayselect() for DateNavigator i have written following code
String dialogText = "abc";
IWDControllerInfo info =
wdControllerAPI.getViewInfo().getViewController();
IWDConfirmationDialog dialog = wdComponentAPI.
getWindowManager().
createConfirmationWindow (dialogText,info.findInEventHandlers("HdayDialog"),"OK");
dialog.show();
but i am getting nullpointerException in this code for the line createconfirmationDialog
regarding action handlers i have created the same handler as mentioned here with exact name
can anyone tell me the reason??
plz help
Deepak
hi,
Use this code for tyhe confirmation window popup
public void onActionSubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSubmit(ServerEvent)
IWDControllerInfo controllerInfo =
wdControllerAPI.getViewInfo().getViewController();
String dialogText = "welcome to the new pop up window";
IWDConfirmationDialog dialog =(IWDConfirmationDialog) wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("submit"),"ok");
dialog.open();
//@@end
}
here on clicking submit a new window is opened
thanks and regards
fazal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi fazal
thanks for reply.
this is the same code am using only that you have used dialog.open() function.
but actually that function is deprecated so i have used dialog.show().
and code execution won't reach till that line since it is getting nulpointer exception at line createconfirmationdialog .
Deepak
hi deepak,
please use this code, it has worked for me
public void onActiondialog(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiondialog(ServerEvent)
IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
String text = "Do you want to proceed";
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow
(text,controllerInfo.findInEventHandlers("yes"),"yes");
dialog.addChoice(controllerInfo.findInEventHandlers("no"),"no");
dialog.show();
//@@end
}
regards,
pinki
Hi Deepak,
IWDConfirmationDialog dialog =(IWDConfirmationDialog) wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("onActionHdayDialog"),"ok");
dialog.open();
Change the event handler name from HdayDialog to onActionHdayDialog. Please recheck the spelling of onActionHdayDialog.
//your code is
info.findInEventhandlers("HdayDialog")
//change it to
info.findInEventhandlers("onActionHdayDialog")
Regards
Abhilash
Hi,
Try to post the stack trace to get a better understanding of the problem
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
I think you have not specified the Event handler with name HdayDialog or could be info.findInEventHandlers("HdayDialog") returning null value
Try this code
IWDControllerInfo contInfo = wdControllerAPI.getViewInfo().getViewController();
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow( "Event String", contInfo.findInEventHandlers( "ok"), "OK");
dialog.addChoice( contInfo.findInEventHandlers( "cancel"), "Cancel");
dialog.show();
// Later create two methods with names ok and cancel
Regards
- Vinod
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.