Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to determine the operationType of a DataArrivedHandler or DataChangedHandler event?

    Hi Isomorphic,

    I'm having a ListGrid to configure system settings.
    These settings are loaded at startup and cached for a few minutes. If there are used and the cache is stale, it is refreshed. Normally there are no changes at all.
    Now in the Admin GUI, the delay is annoying, because if you enable something you need to wait until the system allows you to configure the setting as directly after the change, the cache still shows the setting as disabled.

    If I could force a refresh of my client side cache in those cases, this would help.
    I could add e.g. a DataChangedHandler, but how can I differentiate here between different actions (not all will need a cache refresh). Is there some way to find out operationType and operationId from the incoming DataChangedEvent?

    It does not offer such in SmartGWT, but SmartClient ListGrid.dataChanged seems to support a operationType parameter. So somehow this will be possible in SmartGWT as well, I just can't figure out, how.

    Best regards
    Blama

    #2
    Would having the operationType as is available in SmartClient solve your issue ? Currently the operationId (that you also mentioned) isn't available.

    Comment


      #3
      Hi Isomorphic,

      yes, operationType would be enough for me. There might be operationIds with don't require a cache-invalidation, but that does not matter that much to me, as the request itself is pretty cheap.

      Best regards
      Blama

      Comment


        #4
        It looks like what you want is already there, as far back as SmartGWT 6.1p. Refer to javadoc for ChangedEventhandler.getOperationType().

        Comment


          #5
          Hi Isomorphic,

          thanks, I don't know how I missed this one?!
          Perhaps I looked at DataArrivedEvent, which does not have it. But if my interest is UPDATE, ADD, REMOVE, I assume I'll need DataChangedEvent anyway.

          Best regards
          Blama

          Comment

          Working...
          X