Jump to content

TFDEventAlerter onAlert event executes its code but result gets shown in screen after DataSet refreshing


PuenteWeb

Recommended Posts

Hi, first post here, hope I can express myself clearly.

 

I have a tiny uniGui app as follows:

  • All connection components placed in MainModule / ServerModule as suggested in the uniGui documentation.
  • A MainForm that contains:
    • TFDQuery + TDataSet which executes a simple 'select * from cities' (cityId, Name, ZipCode, CountryID)
    • A uniDBGrid to show Query results
    • A uniEdit that gets filled with the 'Name' field through the TDataSet.onDataChange event
    • A uniButton that .edit, updates Name field with uniEdit.text, and .post
    • A uniMemo
    • A TFDEventAlerter that listens to DB alerts. And, in case of recieveing one, it adds to the memo a 'New Event' string.

                          FDEventAlerter1.Names.Add('QUEUE=?');
                          FDEventAlerter1.Names.Add('SERVICE=?');
                          FDEventAlerter1.Names.Add('CHANGE1=NAME;select name from dbo.cities');

  • DB alerts are being properly generated and sent (trust me, they do).

My problem is that, when an alert ocurrs and the TFDEventAlerter handles it, i think (believe) i should automatically see a new 'New Event' string being written inside the memo, but i dont. I only see it after i forcefully do something that affects the Dataset (click somewhere else in the grid or do some Dataset.Refresh).

In fact, executing an update sentence directly to my dbo.Cities table generates an alert that is captured by my N opened sessions (local Firefox, Chrome, Opera and Firefox in some VM) which is AWESOME because thats 90% of what i want. But i have to go and select some other row from the DBGrid in each of the N-sessions to see the 'New Event' row being displayed in the memo, and THATS NOT the behaviour i want. (And its triggering me a little tbh...).

I thought about doing Dataset.Refresh on the FDQuery.AfterPost event, but that would be completely useless as it only affects every session on changes generated by itself.

Before coming here to write this post, i did the same example in a standard Delphi Desktop App (to discard some random TFDEventAlerter bug) and it does everything as i pretended.

 

Thanks in advance.

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...