Displaying error messages
In this recipe, we will see how we can display messages, such as error messages when a user input is found to be incorrect. We will create a view that will have a button that displays a message when the input is correct (for simplicity's sake, we will focus on the error generation coding in this recipe).
In addition, it is recommended that you use assistance class for storing language-dependent text that is to be displayed in the form of messages. For simplicity's sake, the assistance class has not been shown in this recipe.
How to do it...
In the first step, we will create a
Button
element on our view and give it the captionCheck Data
. Within the events, we will select BUTTON (as the onAction property) from the listbox.A public attribute
MYMESSMANAGER
is defined at the component controller level, the associated type of which is theIF_WD_MESSAGE_MANAGER
interface.Next, we write the relevant code within the
WDDOINIT
method of the component controller. We define an...