NetTalk Central

Author Topic: Sync on Disconnected Web Apps  (Read 6651 times)

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Sync on Disconnected Web Apps
« on: May 12, 2017, 07:20:35 PM »
Hi Bruce,

1. Files are not Synced when browses are opened as Popups. I'm now on ver 9.27.

2. How is the handling of Unique or Auto Number fields when disconnected? What happens when several users get synced with same values specially on more than one record?

Thanks,
Vic




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Sync on Disconnected Web Apps
« Reply #1 on: May 14, 2017, 11:43:27 PM »
Hi Vic,

>> 1. Files are not Synced when browses are opened as Popups. I'm now on ver 9.27.

more information please? Can you narrow down the circumstances when it does and does not work for you, and also the version you upgraded from?
Are you on the latest jFiles and StringTheory versions?

>> 2. How is the handling of Unique or Auto Number fields when disconnected? What happens when several users get synced with same values specially on more than one record?

You cannot use auto Numbered values for the primary key field in distributed systems.
see
http://www.capesoft.com/docs/NetTalk9/NetTalkApps.Htm
in general and
http://www.capesoft.com/docs/NetTalk9/NetTalkApps.Htm#DataSyncAutoNumbering
in particular.

For more background on database design, and the use of Natural vs Surrogate fields and the use of GUIDs I recommend ClarionLive webinar #409.

Cheers
Bruce




http://www.capesoft.com/docs/NetTalk9/NetTalkApps.Htm#DataSyncAutoNumbering

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #2 on: May 15, 2017, 01:02:40 AM »
Hi Bruce,

Ok, will do Webinar 409 first.  JFiles 1.41,ST 2.56. Updated from NT 9.21 which was also doing the same thing. I was just trying the disconnected web app example for the first time. Any Webinar on proper embedding of js codes in assigning values to form fields? Say when a button is pressed, would like to set field to current time and update form immediately without completing the form and pressing save.

Thanks,
Vic


 

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #3 on: May 16, 2017, 12:02:24 AM »
Hi Bruce,

1. I must say Webinar 409 is perfect timing for me just before going into disconnected Apps. It also clarifies the limitation of disconnected apps such as the case of Invoice No. where it means you can't really issue out any "official" value until the app gets connected and properly validated on the primary store and against all clients.

2. Going back to my original problem doing disconnected web app example.

  Case Connected:
                          Popups = yes
                              Records are not synced. Only local client data are viewed in the browse.
                          Popups = No
                              Records are synced. Primary Data store data in browse.
  Case Disconnected:
                          Popups = yes
                              Web App working normally, can edit,save etc.
                          Popups = No
                              Browser responds " you are offline" or "webpage cannot be loaded"

Thanks,
Vic
 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Sync on Disconnected Web Apps
« Reply #4 on: May 16, 2017, 04:16:05 AM »
Hi Vic,

make sure you have the latest StringTheory and jFiles. There have been some updates there over the past couple days which may affect the sync,

If it still doesn't work then perhaps it would be good to work through that example at the Thursday webinar - just remind me then please.

cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #5 on: May 16, 2017, 09:37:08 PM »
Hi Bruce,

It has exactly the same behavior after updating to latest versions, NT9.27, jFiles 1.43, ST 2.60, xFiles 2.89.

Notes on the  disconnected web app/server.app example:

1. I needed to add Client Sync in Global Extensions
2. Also tried adding NetRefresh with no change in behavior


Thanks,
Vic


 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Sync on Disconnected Web Apps
« Reply #6 on: May 16, 2017, 10:47:14 PM »
Hi Vic,

>> It has exactly the same behavior after updating to latest versions

ok, please join me on the User Group webinar tomorrow and we can walk through what is happening.

cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #7 on: May 16, 2017, 10:57:40 PM »
Hi Bruce,

Ok, will try to be awake by then.

Thanks,
Vic

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #8 on: May 18, 2017, 09:43:44 AM »
So sorry Bruce, by the time I joined the Webinar you were discussing NetWebService so I'm not sure whether you have discussed the disconnected Web Apps example by then. It was my first time to join in and my hand was raised but you obviously didn't see it. Perhaps because I was late in joining?

Anyway, I wanted to ask the ff:

1. Are the session variables accessible and active in disconnected mode?
2. What is the correct way of assigning a value to a Form field and  a data store field in javascript?
   For example: Setting INV:Tran_Time = clock() both on the form and also in the client data store. How do you refer to these two in javascript?

Thanks,
Vic

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #9 on: May 19, 2017, 12:37:08 AM »

Hi Bruce,

I tried generating a fresh disconnected web app application and the behavior is exactly the same as follows.
 
When Connected:
                          Popups = yes
                              Web App functioning normally, but Records are not synced to primary data store.
                          Popups = No
                              Web App functioning normally and Records are synced to primary data store.
When Disconnected:
                          Popups = yes
                              Web App functioning normally while disconnected.
                          Popups = No
                              Web App not functioning, Browser responds " you are offline" or "webpage cannot be loaded"


I was just wondering since I had to insert the Client Sync Template to the example server.app whether it was tested to function normally elsewhere?

Thanks,
Vic

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: Sync on Disconnected Web Apps
« Reply #10 on: May 19, 2017, 10:44:55 PM »
Hi Bruce,

I finally got it to work. It's the browser's data saving feature that were disabled on all the devices I initially tested, be it Desktop or Gadgets, after setting data savings ON it was fine.

Is it suppose to still work if it was disconnected from one WiFi network and gets reconnected to another WiFi if both WiFi have access to the app server?

Thanks,
Vic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Sync on Disconnected Web Apps
« Reply #11 on: May 22, 2017, 12:53:20 AM »
>> Is it suppose to still work if it was disconnected from one WiFi network and gets reconnected to another WiFi if both WiFi have access to the app server?

yes.

Cheers
Bruce