on 07-29-2010 6:36 PM
Hi Xperts,
Front-end dynamic validation, we have a requirement, would have to get the "MDM field width" using MDM Java API and we need to check with user input value length for that Field.
Case.
Suppose, we have MDM Field > Address, type "TEXTu201D and width/size "10".
Portal User > Entered length of 15 char for that field.
You will be appreciate, if you can provide the sample code and MDM WebDynPro API u2013JAVA
Thank you
Bala
Hi
I think you have two options:
1. Create a Simple Type say 'SIMPLE_TYPE_ADDRESS' in your Web Dynpro application in Dictionaries-> Local Dictionaries->Data Types->Simple Types with built-in type for this as string and constraint Maximum Length=10.
Then create a context attribute say Address for which type is set to the simple type created above i.e. SIMPLE_TYPE_ADDRESS.
And bind it to your Address InputField.
If the user enter more than 10 characters, he will automatically get the error message.
2. Just create an attribute say 'Address' of the type String.
And onAction of some button, before submitting the data or processing it, validate the field using following line
if(wdContext.currentContextElement().getAddress().length()>10)
{
// Code to display Error Message
}
Option 1 would be the easiest.
Regards,
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.