cancel
Showing results for 
Search instead for 
Did you mean: 

how to display message in the alert box

Former Member
0 Kudos

hi every one,

i am inserting some data into the fields and selecting the button to insert.

but it is inserting even fields are empty..

i want to display "so and so field is empty.. please enter"

it should display a box and return if u press ok.

how to do this

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hai arun,

is there no message box to display the information in the webdynpro...instead creating another view again...

arun_srinivasan
Contributor
0 Kudos

hi

if u want display error message in box u have to go far another window and set the size as required for u

hope this helps,

regards,

Arun

Former Member
0 Kudos

Hi sunil,

try this code inside the condition u r checking for getting the dialog box.

If(//condition for fields that r empty )

IWDControllerInfo controllerInfo =

wdControllerAPI.getViewInfo().getViewController();

String dialogText = "The Field is Empty";

IWDConfirmationDialog dialog =

wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("ok"),

"ok");

dialog.open();

This should help u,

Regards,

Nagarajan.

Former Member
0 Kudos

sunil,

After giving that code,click on the methods tab click eventhandler and give the eventhandler name as <b>ok</b>.

so that this comes as a confirmation dialog to u.

Hope this solves ur problem.

Regards,

Nagarajan.

Former Member
0 Kudos

Hi,

I think this code will help you.

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

{

//@@begin onActionAddressSelected(ServerEvent)

String dialogText = "Would you like to fetch this EmaiId ?";

IWDConfirmationDialog dialog = wdThis.wdGetLoginController().wdGetAPI().getWindowManager().createConfirmationWindow(dialogText,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Yes"),"Yes");

dialog.addChoice(wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Cancel"),"Cancel");

//dialog.addChoice(eventHandler,"OK");

dialog.setWindowPosition(WDWindowPos.CENTER);

dialog.open();

//wdThis.wdGetLoginComponentController().fireAddressSelectedEvent();

//@@end

}

Regards,

Karthick

Answers (3)

Answers (3)

former_member185029
Active Contributor
0 Kudos

Hi,

please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/837d9290-0201">Error handling and validation message</a> tutorial.

Ashutosh

vijayakhanna_raman
Active Contributor
0 Kudos

Hi Sunil,

Check with this link it deals with the dialog box

to show some warnings and a button in the dialog box to

close it. Open this box according to ur condition.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on creating dialog boxes - 10.htm

Regards,

Vijayakhanna Raman

arun_srinivasan
Contributor
0 Kudos

hai sunil,

For displaying message in view at desired place u can use message area and u san align to any position by changing its property.For showing error message in box in same view u have pass value to another window(ex.popup r confirmation dialog) where u validate ur code this is only possible and use button ok for return back to main view . u cannot show error message in a box when u valid it first view.

hope this helps u,

Regards,

Arun