on 09-19-2007 7:28 AM
Hi all,
I have a rquirement to do the validation of input fields.Can anybody explain me how to go for that???Please explain in detail.U can also give me a link where i can find the tutorial for doing this.
Hi Amit,
What everyone has said above is correct - in the method of your action simply test for whatever condition you need to validate for. However, the following tutorial shows you how to use Web Dynpro's Message Manager to display the messages on the screen in an easy user-friendly way:
<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/webdynpro/wd%20java/wd%20tutorials/a%20simple%20input%20form%20with%20message%20and%20error%20service%20support.pdf">Enabling Message and Error Support</a>
In addition, there are some validations that are done automatically depending on what you have your input fields set to - for instance, if you bind your input field to a date and a user enters words into the field instead of an actual date, it will automatically display an error message. To learn how to turn this feature on and off, see this tutorial
<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/edf6ea90-0201-0010-7696-a68662381c12">Using Validating and Non-Validating Actions</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
this is the link for find desired fields.
http://help.sap.com/saphelp_nw70/helpdata/en/0d/5375848e41aa4c86219c80acd054df/frameset.htm
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
if you are looking for your own validation u can get your values as this
String getYourData=wdThis.
wdGetYourComponentController().
wdGetContext().
currentYourNodeElement().
getYourElement();
and pass your data to a method where you do your validations if it meets your requiurements you can pass it on
other wise you can set your error message field like following
wdContext.currentContextElement().setDisplay("Your String");
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
It would be good if you give exact requirement that you need to have for your Input Field validation.
Assume that you need to check whether the input field is empty or not.
1. Create a value attribute called value1.
2. Bind this value1 to the value property of your Input Field.
3. Say you have a button where you need to apply validation of the form(inputfield over here).
So, on action of the button you can check the value of the context attribute
if(wdContext.currentContextElement().getValue1().equals(null))
{
//your logic
}
else
{
// your logic
}
Regards,
Murtuza
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 | |
23 | |
11 | |
9 | |
9 | |
5 | |
5 | |
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.