Page 1 of 1

Braodcasting

PostPosted: Thu Nov 08, 2018 11:46 am
by danny.richadson
How can I write a OnBroadCasting method that only overwrite certain situation and al other situation are handled as 'normal'? In the documenation it is not clear to me how this behavoir works. I would like something like:

function onDataBroadcast(dataSource, action, pks, cached) {

if ((dataSource == '.....' )&& (action == SQL_ACTION_TYPES.UPDATE_ACTION)) {
do something.......
} else {
super() // or some statement that will run de default behavior
}
}

Re: Braodcasting

PostPosted: Thu Nov 08, 2018 11:18 pm
by sbutler
The onDataBrodcast isn't like the Servoy table events where you can stop it by returning false, or change what the default behavior will be. You can only hook into the event, and add extra stuff you want to happen, like notify other Servoy servers about the change. So, by just doing nothing, the default behavior will happen (which is just notifying local clients on the server about the broadcast event)