cancel
Showing results for 
Search instead for 
Did you mean: 

Validate email and telephone data

Former Member
0 Kudos

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 !

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Also check this entry for solution using calculated attributes:

/people/valery.silaev/blog/2005/11/29/800format-your-way

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

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