Jump to content

Refresh unimDBListGrid and unimLabel via unimTimer


andyhill

Recommended Posts

I have a uniDBListGrid and UnimLabel that I want to refresh (update) via a unimTimer - please advise in Delphi code - thanks.

 

procedure TUniMainModule.UnimTimer1Timer(Sender: TObject);
begin
 
  UniMainModule.MyQuery.Refresh; // Data is modified externally
 
  UniSession.AddJS(MainmForm.UnimDBListGrid1.JSName + '.view.refresh();');
 
IF DataPanelmForm is Showing (shown via Disclosure) then update etc.
 
  DataPanelmForm.lblServicedCalls.Text:= 'ServicedCalls: '+IntToStr(UniMainModule.DataSource1.DataSet.FieldByName('ServicedCalls').AsInteger);
 
  UniSession.AddJS(DataPanelmForm.lblServicedCalls.JSName + '.refresh();');
 
END
 
UniSession.Synchronize;
Link to comment
Share on other sites

OK, Trial and Error has shown me that uniTimers/unimTimers only work on the form on which they are placed !

 

I had my timer on the MainModule (so as to reduce resources) and called it from other forms - does not work for me as stated above.

 

Also, the advise I had been given earlier (UniSession.AddJS(MainmForm.UnimDBListGrid1.JSName + '.view.refresh();');) failed because there is no View property. I have dropped the "view" qualifier.

 

​Now working.

 

Posted for the benefit of others that follow.

Link to comment
Share on other sites

×
×
  • Create New...