cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed length for InputField

0 Kudos

Hi

I have InputFilds that have to be limited. For example max length = 3 letters

I set up the property length = 3 but into InputField is possible to be enter more letters. Do you know is it possible for UI InputField to limit the size of entered text?

Message was edited by: Rosen Chaushev

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Create Dictionary type for your attribute (based on string). Set minimum / maximum length constraints as desired.

VS

Former Member
0 Kudos

Hi,

I saw this details in Help from Netweaver studio

Methods in the Web Dynpro IWDAbstractInputField API

There is a method to get the length of your input feild and set the lenth of your input field, you can bind your inputfiels lenth to context attribute which inturn have a property like string,char,int this attribure you will map with Bapi hence on display you will get what you want...

Method Name Parameter Return Value Short Description

getLength int Returns the value of the length property.

setLength (int) Sets the value of the length property.

bindingOfLength String Returns the path of the context element to which the length property is bound. Returns NULL if no binding exists

Former Member
0 Kudos

You are confsing attributes of UI control (IWDInputField->length) with constraints applied to data type (what I was talking above in this thread)

VS

Former Member
0 Kudos

Hi RK,

the length property in the IWDAbstractInputField API has no effect on the number of characters the user can enter in the field.

You can define an input field with length property of 20, but restrict the number of characters which can be typed in the field to 3 letters by setting the maximum data type length restriction Valery mentioned to 3. You can also define an input field with length property = 3, but allow the user to input 20 characters.

It's good practice, that the visible length reflects the maximum length of the data (like automatically done on BAPI imports), but it's <b>not</b> mandatory.

0 Kudos

Hi All

Thanks to all of you

I think that Valery's suggestion is very good and works fine. (with subtype with max length)

Rosen

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

By default Inpu feild has following properties

Name Interface Type Initial Value Bindable ValueRequire

length IWDAbstractInputField int 20 bindable No

if your input feild needs to have 3 charectes , you need to hardcode it in the view(implementation)(String type) and at the same time set the lenth parameter also.

Hope this helps

RK