Announcement

Collapse
No announcement yet.

Refresh Parent Record data in UI after server side process

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Refresh Parent Record data in UI after server side process

    Hi,

    I have a parent child relationship (one to many).
    Updates on the child record trigger a hook that updates values on both the child record and its parent record.
    The child record data is updated in the UI but the parent data is not.
    How can I refresh a parent record from the context of a child record?

    I have tried
    HTML Code:
    this.model.fetch();
    this.model.trigger('update-all');
    but this does not appear to work when done from the child context.

    Is it possible to get each view/entity displayed on the screen and interact with them from another?



  • #2
    The problem was solved by doing the server side processing in a repository instead of using a hook. The data sent back after a using a repository had the latest values. The hook sent back old values.

    Comment


    • telecastg
      telecastg commented
      Editing a comment
      Thanks for providing the solution !

      Understanding program flow makes development a lot smoother and has been one of the trickiest parts for me.
      Last edited by telecastg; 06-28-2020, 05:45 PM.
Working...
X