Show TOC

sap.ui.model.type.StringLocate this document in the navigation structure

The String data type represents a string.

The source value (value given in the model) must be given as a number and is transformed into the type of the bound control property:

  • string: No transformation needed
  • integer/float: String is parsed accordingly
  • boolean: "true" or "X" are interpreted as true, false, and " " as false

The string type does not have any format options.

Example how a String type can be initialized:

// The source value is given as string. The length of the string must not greater than 5.
var oType = new sap.ui.model.type.String(null, {maxLength: 5});

The String type supports the following validation constraints:

  • maxLength (expects an integer number)
  • minLength (expects an integer number)
  • startsWith (expects a string)
  • startsWithIgnoreCase (expects a string)
  • endsWith (expects a string)
  • endsWithIgnoreCase (expects a string)
  • contains (expects a string)
  • equals (expects a string)
  • search (expects a regular expression)