Official Content

Defines the action to be performed when a web notification is received.

Syntax

Event OnMessage(&VbleBasedOnNotificationInfoSDT)
        Event_code
EndEvent

Where:

&VbleBasedOnNotificationInfoSDT
     Variable based on the "NotificationInfo" Structured Data Type (SDT) object

Event_code
    Code defined inside the event to process the info received in &VbleBasedOnNotificationInfoSDT.

Scope

Objects: TransactionWeb Panel
Generators: .NET.NET FrameworkJava

Description

By using the Server.Socket external object, it is possible to send information from the server to a client (or all of them) without being requested by the client. These are silent notifications received on the client side.

Thus, when a web notification is received on the client side, the OnMessage Event is executed receiving by parameter a variable based on the "NotificationInfo" SDT:

image_2024813142422_1_png

Inside this event, the received information must be processed as you consider convenient.

For example, consider a Knowledge Base to manage hotel reservations.

Suppose that when a hotel reservation is inserted, all the users viewing that hotel should receive a notification alerting that someone has made a reservation.

On the server side, after loading the SDT variable, the broadcast method must be executed to send the notification to all users.

On the client side (Web Panel object or Transaction object), inside the OnMessage event, you have to enter the code to compare if the Id SDT member (the reserved hotel) matches one of the shown hotels to display a message.

See Also

Server.Socket external object

Last update: June 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant