on 04-23-2009 4:23 PM
Hi experts,
can anybody tell me How we perform client side validations in web dynpro ?
Thanks,
Prasad.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer these links,
Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.