Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.3 KB

sap-ui-model-type-string-91f31c2.md

File metadata and controls

37 lines (25 loc) · 1.3 KB

sap.ui.model.type.String

The String data type represents a string.

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

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

The string type does not have any format options.

Example how a String type can be initialized:

// "TypeString" required from module "sap/ui/model/type/String"

// The source value is given as string. The length of the string must not be greater than 5.
var oType = new TypeString(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)

For more information, see API Reference: sap.ui.model.type.String.