Feature Rich
Rapid Application Development
Helping you or your customers
Manage their Business

All Commands All Other
Commands

WEBSOCKET_SEND

This will send a Web Socket message to all currently connected specified users.

Use the following JavaScript to act on the received message:

You do not need the {WEBSOCKET_REQ()} command on a page to send messages using the {WEBSOCKET_SEND} command.

You do need the {WEBSOCKET_REQ()} command on a page when using the JavaScript Function udb.webSocket.sendMessage(ug_list, type, obj_id, title, message) to send a message from the client.

Number Name Default Type Description
1 ug_list String

A comma separated list of User IDs or Group Names you want to send the message to.

e.g. [9876, 5432] or [Group1, Accounts]

2 type console.log String

The type of message to be sent.

This is simply a way of categorising the message so the receiving code knows what to do with it.

There are some reserved types that are handled automatically by the code, and can be used for testing.

  • console.log - Will send the received data to the client console
  • page.redirect - Will cause the recipients page to instantly redirect to the one specified with the obj_id.
    If the message data starts with a ?, it will be passed as parameters to the page.
  • page.refresh - Will cause the recipients page to refresh.
  • page.alert - Will cause an alert window to be displayed on the recipients screen containing the message.
  • page.dialog - Will bring up a Dialog box containing the message if the obj_id is zero.
    If the obj_id > 0, it will display the page and pass the message as the parameters as with page.redirect.

3 obj_id 0 Integer An object to send to the recipients
4 title String An optional message title to send
5 message String A message to send to the recipients
to add a Comment.