Loading...
 

CX_WIDGET::SetValidationState

CX_WIDGET::SetValidationState

194050

Description:

This method gives the developer the opportunity to give the user feedback on his input. If the user enters invalid values, the incorrect input field can be marked and an explanation of the error can be stored.

The validation state consists of a level(ERROR, WARN, INFO), which defines the colour coding of the widget and a descriptive text, which is displayed as a tooltip above the widget. If a validation state is set, a previously set validation state of the widget is overwritten.

The validation state of a widget is deleted either by a ClearWindow of the containing window, or by a ClearValidationState on the widget or a parent widget.

The validation state of a widget is currently only displayed in the MorphIT interface. Native this has no visual effects.

Code example:
Widget(,StringWin) Call(ClearValidationState) GetValue(,Str) Cardinality case 0: ERROR T("String darf nicht leer sein", "String must not be empty") 1: WARN T("String hat nur 1 Zeichen", "String has only one character") default: INFO T("Alles OK", "Everything OK") endCase Widget(,Str) Call(SetValidationState)

Stack
Stack Position Object type Brief description
Stack(In) Top CX_WIDGET The input field
Top 1 MULTIPLE_STRING The validation text to be displayed
top 2 NOTIFICATION_LEVEL The level of the validation message
Stack(Out) Top - -
Function call: Call(SetValidationState)