Data broadcast in Web Client

Forum to discuss the Web client version of Servoy.

Data broadcast in Web Client

Postby vincentSchuurhof » Wed Sep 22, 2010 6:29 pm

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.
vincentSchuurhof
 
Posts: 26
Joined: Fri Aug 21, 2009 12:39 pm

Re: Data broadcast in Web Client

Postby Harjo » Wed Sep 22, 2010 7:57 pm

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
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Data broadcast in Web Client

Postby vincentSchuurhof » Thu Sep 23, 2010 11:17 am

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:/<database server>/<table name>

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?
vincentSchuurhof
 
Posts: 26
Joined: Fri Aug 21, 2009 12:39 pm

Re: Data broadcast in Web Client

Postby Harjo » Thu Sep 23, 2010 11:41 am

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.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Data broadcast in Web Client

Postby vincentSchuurhof » Thu Sep 23, 2010 12:06 pm

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...
vincentSchuurhof
 
Posts: 26
Joined: Fri Aug 21, 2009 12:39 pm

Re: Data broadcast in Web Client

Postby Harjo » Thu Sep 23, 2010 12:55 pm

hmmm, that is new to me...
Maybe Servoy can comment on this one...
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Data broadcast in Web Client

Postby jcompagner » Thu Sep 23, 2010 4:14 pm

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?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Data broadcast in Web Client

Postby Harjo » Thu Sep 23, 2010 4:41 pm

oke, I misunderstood this...
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Data broadcast in Web Client

Postby vincentSchuurhof » Fri Sep 24, 2010 10:40 am

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?
vincentSchuurhof
 
Posts: 26
Joined: Fri Aug 21, 2009 12:39 pm

Re: Data broadcast in Web Client

Postby rgansevles » Fri Sep 24, 2010 11:45 am

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.

2. there is no accumulation of changes

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Data broadcast in Web Client

Postby vincentSchuurhof » Fri Sep 24, 2010 2:03 pm

Thank you Rob, I was not aware of these functions...
vincentSchuurhof
 
Posts: 26
Joined: Fri Aug 21, 2009 12:39 pm


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 5 guests