Skip to Content
author's profile photo Former Member
Former Member

How to do validation of input fields

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 06:32 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:07 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:27 AM

    Hi,

    this is the link for find desired fields.

    http://help.sap.com/saphelp_nw70/helpdata/en/0d/5375848e41aa4c86219c80acd054df/frameset.htm

    Thanks,

    Lohi.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 01:07 PM

    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:

    Enabling" target="_blank">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

    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

    Using" target="_blank">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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.