cancel
Showing results for 
Search instead for 
Did you mean: 

client side validations in web dynpro

Former Member
0 Kudos

Hi experts,

can anybody tell me How we perform client side validations in web dynpro ?

Thanks,

Prasad.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prasad,

WebDynpro does not support Java Script validations and you have to perform the validations required using WD API only.

Thanks & Regards,

Jhansi Miryala

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Prasad,

You can follow this approach for validatind data before processing the data:

Create a method, say validations() which returns a boolean.

Inside the method, you can have a boolean variable and conditions to check the data, as soon as some condition fails you can change the state of the boolean variable and return it.

For triggering this action on a Button click, what you can do is put a condition and call validations method and proceed only if it returns true.

like if(validations()){ further processing }

Hope this helps!!

Cheers,

Arafat

Former Member
0 Kudos
pravesh_verma
Active Contributor
0 Kudos

Hi Prasad,

Validations are generally required during some events or calls to a functions. So there are bascially two ways:

1) You do the validation is the onActionEvent of the UI element. However this is some time time is not a right approach (depends upon your scenario).

2) There is another method called wdDoBeforeAction(). Do all you validations for the actions in this method. read the java doc for the same functions, here:


/**
   * Hook method called for additional validation of user input. <p>
   *
   * @param validation Interface for reporting validation errors
   */

You can catch the particualr action in this emthod and then can write you validation code before the action is called.

For gettiong the action use this code:



if(validation.getCurrentAction().equals(IPrivate<Your_View_Name>.WDActionEventHandler.<ACTION_NAME>)){

// write your validation code here.		  
}

I hope this will help you. Please revert back in case you have further issues.

Thanks and Regards,

Pravesh

Former Member
0 Kudos

You can use the onAction() methods which can bound to the UI Elements....and use the standard wdDoModifyView() method and IWDMessageManager Class to define client side validations....

Hope it helps.

Regards,

Shikhil