on 11-17-2005 4:06 PM
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 !
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also check this entry for solution using calculated attributes:
/people/valery.silaev/blog/2005/11/29/800format-your-way
Valery Silaev
EPAM Systems
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.