cancel
Showing results for 
Search instead for 
Did you mean: 

InputField Length

sid-desh
Advisor
Advisor
0 Kudos

Hi,

I have an input field on the view and i have mapped the length property to the context attribute. In the doModifyView i set the length from the string length that i need to display in the field.

However i have found that even after i set the length there is still quite a lot of space remaining between the last character and the border of the field. How can i eliminate this space. i need to do this for formatting my output.

Regards

Sidharth

Accepted Solutions (0)

Answers (1)

Answers (1)

MarcoErtel
Advisor
Advisor
0 Kudos

Hello Sidharth,

the space between the last character and the end of the field differs because Web Dynpro uses a proportional font to display the text.

kind regards

Marco

sid-desh
Advisor
Advisor
0 Kudos

Hi Marco,

Is there any way to eliminate it.

Regards

Sidharth

thomas_chadzelek
Participant
0 Kudos

Stupid question: is it really a good idea to adjust the input field's width every time its content changes? If the input field is editable, that could be quite disturbing, I guess. If it's read-only, consider using a TextView instead.

Bye,

Thomas

Former Member
0 Kudos

Hmmmm...

Not-so-stupid question.

Not-so-rare-case: a necessity to implement padding with zeros for user entered values, so after any action (onEnter f.e.) field has fixed length. Fixed-length data is a commodity rather then exception, IMHO.

VS

thomas_chadzelek
Participant
0 Kudos

Good point. I would see this as a feature request to our Java data dictionary. The DDIC is the "component" that takes care of parsing and formatting data. You could then create a data type and declare its fixed length and that leading zeroes are used for padding...

I'm not a DDIC expert. But I know that they support a format pattern. Maybe one can (mis)use it for this fixed length purpose.

Best regards,

Thomas

Former Member
0 Kudos

Come on. The input fields I know have almost always a fixed length.

Former Member
0 Kudos

hi,

i've got a similar question:

i want to limit the length of an inputfield to 10 characters. in html this woul be the maxlength attribute. I assigned a contextVariable type <i>com.sap.ide...InputFieldSize</i>. How do I tell the context to accept only 10 chars?

I also set 10 in the properties length-field. Does not work. How do I fix that?

thanx, matthias

Message was edited by: matthias kasig

Message was edited by: matthias kasig

Former Member
0 Kudos

10 as property "length" of IWDInputField serves different purpose -- it is approximate visual size of control in charactres (same as with HTML <input type="text").

To restrict max length of value you have to declare string-based data type in dictionary and set MaxLength or FixedLength constarint to 10.

VS

Former Member
0 Kudos

hi valery,

there is noly length and size as property declared for an inputfield-no MaxLength or FixedLength. I don't know what you mean by declaring a stringbased data type in the dictionary. I can create a simple type in the local dict. but what's the use of it?

I can only assign length and size, but none of those properties seem to deliver the effect I want...

matthias