0

I need to limit the textarea to 4 characters...

my current javascript

{
    name : "pin",
    title : "PIN",
    align:"center",
    textArea:"isc.TextArea.setCharacterWidth(4)"
}

Can anyone tell me how can I do that please?

stackoverfloweth
  • 6,669
  • 5
  • 38
  • 69
user3863488
  • 227
  • 1
  • 13

2 Answers2

2

You can use following methods both on TextAreaItem and TextItem:

    text.setEnforceLength(true);
    text.setLength(4);
dafilipaj
  • 1,064
  • 14
  • 24
1

You can use TextAreaItem field of smartgwt to create multi-line text area. To restrict the number of characters for this field, setLength can be used.

For example:

private TextAreaItem text = new TextAreaItem("pin", "PIN");
text.setLength(4);
text.setAlign(Alignment.CENTER);