Announcement

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

    Recurring call when executing saveAllEdits()

    Hello, Isomorphic:

    We are using:
    SmartGWT 13.0
    Java 1.8.0.
    GWT 2.8.2

    Currently, we employ the saveAllEdits() method to perform the save for bulk editing of records. This method has an internal function that is executed at the end of the save process. However, we have noticed a problem: when executing saveAllEdits(), the system enters the dataArrivedHandler() once for each modified record. For example, if 100 records are modified, the dataArrivedHandler() is executed 100 times when pressing the save button.

    Is this behavior normal?
    Is there a way to prevent the dataArrivedHandler() from being invoked repeatedly for each modified record?

    Translated with DeepL.com (free version)

    #2
    You probably meant dataChanged()?

    Either way, it sounds like you have logic attached to a handler and you don't want to have that logic run 100 times.

    So, set a flag when you call saveAllEdits() and clear it at the end, and while that flag is set, don't call your logic.

    Comment


      #3
      Currently we have a flag to not execute the logic inside the dataArrivedHandler() event. What we need is not to call this event, since it tries to paint on the screen each modified record causing slowness in handling the save.

      Comment


        #4
        If you're referring to actions taken by the framework, it doesn't repaint per call, it doesn't repaint per-call in this circumstance.

        If you're referring to your own code being triggered by a handler, use a flag to prevent duplicate work.

        Comment

        Working...
        X