Skip to Content
avatar image
Former Member

Validate email and telephone data

We are designing a WD app for external users to register for system access. Need to know what the best practices are to validate user information such as email, telephone etc. Dont see any built-in data types to validate above data inputs.

Is there a way to create context attributes of special types (email, telephone etc.), bind them to UI elements, so that when the user submits the form, the WD data type validation kicks in and they get something like an "Invalid Data Format" message ?

Do let me know. Thanks !

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 17, 2005 at 04:18 PM

    Srikanth,

    Not that simple: you may not apply "format" for data types other then date/time/number. And here you need strings...

    Probably you may use approach with JavaBean model classes. See my weblog post /people/valery.silaev/blog/2005/06/29/apojo--almostplain-old-java-objects-as-model -- here I apply SSN validation, mail and phone are just the same.

    If this sounds too complex then:

    1. Create a pair of attributes: one internal (not bound to UI controls), and one external -- for user input

    2. Make external attribute calculated -- in getter just return internal value, in setter validate input by pattern and then assign value to internal attribute.

    Valery Silaev

    EPAM Systems

    http://www.NetWeaverTeam.com

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Nice weblog, Valery!

      With the same technique you can also do things like "intelligent" editing of numbers, e.g. you can create a table column for editing numbers where you can enter "20%" or whatever and the attribute setter.method calculates the new value.

      Armin