DVMessage

WorkWithPlus provides the possibility to show the messages of the application with different styles by using this User Control. During the execution of the "Design System Wizard" you can define which style will be used for the messages:

UCImg03

This kind of messages can be used in Transaction in order to replace the default GeneXus messages.

Clear all shown Messages

This UserControl provides the possibility to clear all messages that are being displayed in the form. In order to do this, you need to add the following command:

msg("<#CLEAR#>")

 

Edit Message Style

First, you must import the xpz, located in the following folder: 
 

    <GXDIR>\UserControls\DVelop\DVMessage\DVMessageResources.xpz

 

After that, in the event where you want to trigger the message you must add the following code:

 

msg( DVMessageGetBasicNotificationMsg.Udp(!"NameWindowMessage!", "Message description" ,DVMessageType.MessageType, "", DVMessageBoolean.True,"") )                           

 

Values:

  • DVMessageType.error
   msg( DVMessageGetBasicNotificationMsg.Udp(!"Error!", "Message description" ,DVMessageType.error, "", DVMessageBoolean.True,"") )

                      DVMessageImageError

  • DVMessageType.information
   msg( DVMessageGetBasicNotificationMsg.Udp(!"Information", "Message description" ,DVMessageType.information, "", DVMessageBoolean.True,"") )

                      DVMessageImageInfo

  • DVMessageType.regular
   msg( DVMessageGetBasicNotificationMsg.Udp(!"Regular", "Message description" ,DVMessageType.regular, "", DVMessageBoolean.True,"") )

                      DVMessageImageRegular

  • DVMessageType.succes
   msg( DVMessageGetBasicNotificationMsg.Udp(!"Success", "Message description" ,DVMessageType.success, "", DVMessageBoolean.True,"") )

                      DVMessageImageSuccess

 

Validation of a field

In a transaction form, we can validate a field by adding a message next to the field:

                      DVMessageImageValidacion

 But in a Web Panel, we don't have that behavior.

With DVMessage we can add a message error as in a transaction.

So, you must add an event for the field:

Event <fieldName>.IsValid

    if <field>.IsEmpty()
        msg( DVMessageGetBasicNotificationMsg.Udp(!"Error!", "Message description" ,DVMessageType.error,!"#" + <fieldName>.InternalName, DVMessageBoolean.True,"") )
    Endif

EndEvent

For example:

Event Person_PersonName.IsValid

    if PersonName.IsEmpty()
        msg( DVMessageGetBasicNotificationMsg.Udp(!"Error!", "The name is required" ,DVMessageType.error,!"#" + Person_PersonName.InternalName, DVMessageBoolean.True,"") )
    Endif

EndEvent

So we see it at runtime:

                      DVMessageImageErrorCampo