Data broadcast in Web Client

I was testing the data broadcast mechanism on the Web Client and I found the following situation not to work:

Session 1 is in find mode and session 2 adds a record to the same table (whether in find mode or not). In that case session 1 is not updated and doesn’t see this new record appear. But, if session 2 modifies or deletes a record then session 1 is updated properly. A new record appears when session in is not in find mode though.

The same thing happes when you’ve narrowed your foundset by using a query. Changes are being updated, but new records are not.

that is correct,

new records are not broadcasted!, only new records in related foundsets, and updates in records are broadcasted.
look also here: viewtopic.php?f=22&t=14078&p=78121&hilit=broadcast#p73999

Thanks for your reply, Harjo.

I guess in that case I would have to work with the onDataBroadcast option in case I want to refresh and display new records automatically. I tried that a bit and there are a few available parameters. For example, the parameter dataSource is returned as a string:

db://

Is there any specific way to extract the database server and table? Or should I just write something myself?

And last but not least, is the onDataBroadcast method executed for each individual change? Or are changes accumulated and sent (in an array or something) at once?

no, new records are NOT databroadcasted! else the auto broadcast, would have worked out of the box.
you can work with a scheduler that does a refresh.

I am not sure if we are talking about the same thing here. What I mean is that if a new record has been added to a table, the onDataBroadcast method is triggered for the other session (although the automatic broadcast mechanism doesn’t result in showing it). If I determine for which table this happened (by using the receiving parameters), I can execute a refresh of the foundset which has been retrieved by a query.

I tried this and it works…

hmmm, that is new to me…
Maybe Servoy can comment on this one…

you will get databroadcast for new records of the tables you have touched in the client.

How else can we update related foundsets with the new data if we dont get all the new records broadcasted?

oke, I misunderstood this…

Ok, since we got that out of the way. :-) I still have 2 remaining questions:

  1. Is there any specific way to extract the database server and table from parameter dataSource? Or should I just write something myself?
  2. Is the onDataBroadcast method executed for each individual change? Or are changes accumulated and sent (in an array or something) at once?

Vincent,

  1. there are 2 methods to get the server/table name from a data source:
    databaseManager.getDataSourceServerName(dataSource)
    databaseManager.getDataSourceTableName(dataSource)

Note that most (if not all) servoy methods work with data source string, so you probably don’t need to convert.

  1. there is no accumulation of changes

Rob

Thank you Rob, I was not aware of these functions…