Datas are not synchronized in WebClient

Forum to discuss the Web client version of Servoy.

Datas are not synchronized in WebClient

Postby wcompaore@cegid.fr » Thu May 26, 2011 10:21 am

Hi,

I have a strange behaviour between WebClient and SmartClient.

I joined a sample solution for you to see it too.

I have a form splitted (with a split panel) in two parts : on the left, the list of clients, on the right, the client form.
The field "nom" is displayed on both.
Client datas are spread on two tables : "client" and "client_etendu". They are joined in Servoy by a relation.
The datasource of my forms is table "client_etendu".
The field "nom" is in "client" table.

On SmartClient, if I modify the field "nom" in the form, the field is updated instantly in the list.
On WebClient, I If do the same, the list is not updated. I have to press F5 or restart the application to see it.

Can you explain why ? Is it a WC bug ?

Thanks
You do not have the required permissions to view the files attached to this post.
William Compaoré
wcompaore@cegid.fr
 
Posts: 13
Joined: Wed Apr 27, 2011 2:53 pm

Re: Datas are not synchronized in WebClient

Postby jcompagner » Thu May 26, 2011 6:18 pm

problem is that the data is not getting saved. (in webclient the data doesn't get saved when you just click somewhere in the browser)

If i place in the right for a button that does : databaseManager.saveData() then it works fine. you will see it updating

The thing is that even if i change selection through the left list, it also doesn't change, i will investigate that.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Datas are not synchronized in WebClient

Postby wcompaore@cegid.fr » Fri May 27, 2011 9:32 am

Hi,

Yes you are right, my explanation was not sharp enough : after I type in the field, I click in the left list and change selection, I expect to see it updated, but in WC, it does not work.

Thanks.
William Compaoré
wcompaore@cegid.fr
 
Posts: 13
Joined: Wed Apr 27, 2011 2:53 pm

Re: Datas are not synchronized in WebClient

Postby jcompagner » Fri May 27, 2011 12:28 pm

that is because the data doesn't get saved.
You also see the same effect in the smart client when you just jump the the next field in the recordview on the right.
That you see it in the smart client when you click again on the list is more 'by accident' because then the whole list is being repainted, not because the list knows it has to repaint.. (and because of that web doesn't repaint at all)

Then you also don't see it updated, this is because how you did set it up. Everything you show is again related data, So you edit related data on the right and you show related data on the left in the listview/tableview
Those constructs don't update on modification currently in servoy, those only update when the data gets saved.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Datas are not synchronized in WebClient

Postby wcompaore@cegid.fr » Fri May 27, 2011 2:06 pm

Ok,

So I have to change my datasource in my form and to link it to the other table, or there is another way to update display ?
William Compaoré
wcompaore@cegid.fr
 
Posts: 13
Joined: Wed Apr 27, 2011 2:53 pm

Re: Datas are not synchronized in WebClient

Postby jcompagner » Fri May 27, 2011 2:11 pm

Do a saveData() at some point. for example when the selection changes in the foundset you show on the left. (so in the onRecordSelection you do: database.saveData())
Because you don't save your data currently that often, if you jump from record to record the data is not saved because you don't touch the actual main record at all. Just some related data.

But it seems you show pure related data on both sides, so why not have those 2 forms based on the related table instead of the main?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Datas are not synchronized in WebClient

Postby wcompaore@cegid.fr » Mon May 30, 2011 11:16 am

In my real solution, I have a 10 forms related to "client_etendu", and 12 related to "client".

So how can I choose the main table ? Do I have to create a View, joining these two tables ?
William Compaoré
wcompaore@cegid.fr
 
Posts: 13
Joined: Wed Apr 27, 2011 2:53 pm

Re: Datas are not synchronized in WebClient

Postby jcompagner » Mon May 30, 2011 11:25 am

if you really have to edit everything through a relation, so the main table is the one that has the selection and the data you show/edit is shown through a relation
please make sure that you save then when the selection of the main table changes. Call saveData() in the onRecordSelection()

Especially in the webclient you need to have a bit more explicit save data calls because there we don't have the automatic save when you click on the form (not in a field)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Datas are not synchronized in WebClient

Postby wcompaore@cegid.fr » Mon May 30, 2011 11:30 am

Ok,

I will add explicit save actions.

Thank you for tour advises !
William Compaoré
wcompaore@cegid.fr
 
Posts: 13
Joined: Wed Apr 27, 2011 2:53 pm


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 10 guests