Announcement

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

    Related Updates and Refreshing Formatted Cells

    I have a ListGrid that has an expansion component which is another ListGrid (parent and child list grids). The data sources for the parent and child ListGrids are separate. When records are updated in the child, I have added custom DMI logic to execute the fetch for the parent row as well and return that update via the DSResponse.relatedUpdates mechanism. I've looked in the developer console and the updates are happening correctly as I would expect. The issue is I'm not seeing the fields in the parent list grid row updating, even though the data as seen in the console is obviously different. The fields that I'm interested in have a custom CellFormatter to display the data. Will fields that use a custom CellFormatter update when they receive updates from a relatedUpdates DSResponse? If not, what method would I need to call to cause them to update?

    #2
    Yes, they would update, you should see that the formatters are being run.

    If they are not, calling refreshRow() would force a refresh, so if that works then the issue is that the refresh is not automatic. It should be, so we’d need a way to reproduce the problem in order to look further.

    The other possibility would be that your formatters are running, but they are written in a way that they don’t use the new data (eg your code may use caching or something)

    Comment


      #3
      I put some debug statements in the formatter, it is indeed being run. However, it does not every see the correct value after an update. I'm calling record.getAttribute() on the passed in record from CellFormatter.format(). Is there an easy way to verify that the data from the parent listgrid is being updated from the relatedUpdate?

      Comment


        #4
        Is the operationType of the related update you send UPDATE and does include all PK fields?

        Comment


          #5
          You don’t need to do anything more than ordinary getAttribute() calls. Your results suggest that the data is simply not being updated. Blama’s suggestions are indeed good things to check on. You can also enable the ResultSet log category to get detailed logs of how the update is processed.

          Comment


            #6
            That's it! Thank you again Blama, I was returning the related update as a fetch instead of an update.

            One more related question, now that my parent grid is getting updated correctly, it is now collapsing the expanded component when it receives the updated record, is there a way to stop this behavior?

            Comment


              #7
              That’s by design, as the expansion components are usually based on the record data hence may be stale, or no longer available for that record. You can simply call expandRecord() if automatic re-opening is desirable in your application.

              Comment

              Working...
              X