cancel
Showing results for 
Search instead for 
Did you mean: 

How to set field length ?

Former Member
0 Kudos

Hi All,

I am using TextEdit element.I want to set a fixed length for this dynamically.Please help me regarding this.

thanx

anirudh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Create two attribute with type int and bind it to the Text Edit's rows and cols .

You can change the value at run time

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

Thanx fr ur quick response.Only i have a TextEdit Field.According to u, i did the binding also.Can u please send me the code for this.Only one view is there with one textedit field.i need to set the field length for this.Please help me.

thanx

anirudh

Former Member
0 Kudos

Hi

For example you set the test to the text edit.

String text="Some text";

int len=text.length();

wdContext.currentContextElement().set<col>(len);

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

create one int type attribute and bind it to the cols property of TextEdit.

if you had done the bindings already then do the following.

In DoInit part write,

wdContext.currentContextElement().set<lengthattrib>(50);

regards

karthik

Former Member
0 Kudos

Hi Mukesh,

One more doubt.I want to create the the textedit field and set the field length dynamically.Please help me with an example.

thanx

anirudh

Former Member
0 Kudos

Hi

I guess you are looking to set the "max length" of the textedit so that you can limit user's input to some length. Try this

IWDAttributInfo attrInfo = <get attribute info> // get attribute info for attribute to which value property of textedit has been bound
int maxLength = <get max length dynamically>; // get max length to be specified
attrInfo.getModifiableSimpleType().setMaxLength(length);

Regards

KK.

Former Member
0 Kudos

Hi Kishore,

still i am not getting you.I want to set the field of textedit as fixed one.Not more than 50 it should take.help me ..

thanx

anirudh

Former Member
0 Kudos

Hi

See this Thread

Kind Regards

Mukesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can create a simpletype and provide the length and bind to the attribute and get the result

have a look at this threads

Regards,

Saravanan K