CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Refresh multiple client instances

Questions & Answers about IWCGJQuery Suite.

by FredT » 05 Apr 2019 15:05

Hi,

In a test project, I have a form with only checkboxes. I launch the server and several clients.

I would like that when I check a box in a client, it update the check box on all other clients, but I did not understand how to do it!

I can initialize checkbox values ​​only when I create a new client instance, but not update checkbox values on existing instances.

Code: Select all
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
    MyChecked := IWServerController.GetChecked;

    IWCheckBox1.Checked := MyChecked.Checked_1;
    IWCheckBox2.Checked := MyChecked.Checked_2;
    IWCheckBox3.Checked := MyChecked.Checked_3;
    IWCheckBox4.Checked := MyChecked.Checked_4;
    IWCheckBox5.Checked := MyChecked.Checked_5;
end;

procedure TIWForm1.IWCheckBoxAsyncChange(Sender: TObject; EventParams: TStringList);
begin
    MyChecked.Checked_1 := IWCheckBox1.Checked;
    MyChecked.Checked_2 := IWCheckBox2.Checked;
    MyChecked.Checked_3 := IWCheckBox3.Checked;
    MyChecked.Checked_4 := IWCheckBox4.Checked;
    MyChecked.Checked_5 := IWCheckBox5.Checked;

    IWServerController.SetChecked(MyChecked);
end;


Thank.
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by Alexander Bulei » 05 Apr 2019 16:04

Hi FredT,

I would like that when I check a box in a client, it update the check box on all other clients


You need use IWTimer (e.g: timeout: 300), and call the code to update the checkboxes.

You can use the global vars or db.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by zsleo » 06 Apr 2019 21:28

I think IWMonitor is better than IWTimer for this situation.

It does require more coding....
zsleo
 
Posts: 776
Joined: 03 Feb 2013 03:33

by FredT » 09 Apr 2019 10:45

Hi Alexander,

Thank you for all.
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10


Return to Q & A

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.