Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.97 KB

Reacting_on_User_Input_Events_c75861e.md

File metadata and controls

53 lines (35 loc) · 1.97 KB
loio
c75861e33942410d9ac77322763db203

Reacting on User Input Events

User input events can either be handled automatically by the framework or manually by the application.


User input errors can be detected automatically by the framework. This is the preferred way of handling such events and requires the use of a Component for your app in accordance with UI5 Best Practices. You can activate the automatic generation of validation messages in the "sap.ui5" section of the manifest.json file as follows:

Example:

Activating automatic user input event handling

{
  ...
  "sap.ui5": {
    ...
    "handleValidation": true
    ...
  }
}

Controls implementing the refreshDataState method then automatically display messages corresponding to the following four Core events:

  • FormatError
  • ParseError
  • ValidationError
  • ValidationSuccess

For more information, see sap.ui.model.DataState.


If your app does not use a Component, you need to manage user input errors manually by creating the desired validation messages and adding them to the message manager. As the messages require the UI binding and type, you would have to manually type and bind your input fields. For more information, see Validation Messages.