on 02-19-2010 8:10 AM
1. It is necessary to allow entry into InputField only digits.
2. The number of digits is limited to 5.
There is a context attribute "Code" of type string.
I have a code:
ISimpleTypeModifiable attributeType = wdContext.nodeCreateParams (). GetNodeInfo (). GetAttribute ( "Code"). GetModifiableSimpleType ();
attributeType.setMaxLength (5);
But I do not know how to allow entry only digits.
I would be grateful for your help!
Hi Vitaly
The problem is you cannot apply a format pattern to String based simple type.
The restriction can be overcame if you make the attribute Calculated. Then in setter-method you can perform the string parsing according to your 5-digits rule. For the purpose you can use Java class MessageFormat.
If the input string coming to the setter does not follow to the 5-digits rule, report the corresponding error message using method:
wdComponentAPI.getMessageManager().raiseInvalidContextAttributeMessage(...);
Hope this will help you.
BR, Siarhei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answers and your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is How to make permission to enter Only Digits in String Context Attribute?
Now user can enter strings like:
abcde
gu4.%8
etc.
And I need to prohibit entry of non-numeric characters
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
1. It is necessary to allow entry into InputField only digits. -
2. The number of digits is limited to 5.----
it depends on you requirement
Create Simple Type (with String and length Constrints>here you can specify max and min length) in the Dictionary.
Assign it to attribute you have created in Context.
Hope this will helps you.
Thanks
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.