cancel
Showing results for 
Search instead for 
Did you mean: 

MDM Text Field width?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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