cancel
Showing results for 
Search instead for 
Did you mean: 

Creating runtime data types

Former Member
0 Kudos

Hi

I need to dynamically create input fields with specified lengths(so that user cannot enter values beyond this length).

I do it like this.

IWDAttributeInfo attributeInfo = 
    nodeName
    .getNodeInfo()
    .addAttribute(attributeName,
       "ddic:com.sap.dictionary.string");
IWDInpuField inputField = 
   (IWDInpuField)viewHandle
                  .createElement
                  (IWDInputField.class,null);
int length = getLengthFromSomeMethod();
inputField.bindValue(attributeInfo);
inputField.setLength(length);

The input field added is of specified length, but still the user is able to enter value beyond this length. This i guess is due to the fact that attribute bound to the field is of type "ddic:com.sap.dictionary.string".

Can i create data types at runtime so that i might add attributes with this data type to a node at run time?

Is there any other way to solve this problem?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

kaushal,

Try this:



attributeInfo.getModifiableSimpleType()
  .setMaxLength(length);

;

"Length" of InputField declares (average) width of control in characters.

VS

Former Member
0 Kudos

Perfect.

Thanks

kk

Answers (0)