Announcement

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

    Pattern to follow for saving header & related details

    I have a common order object with a header and multiple detail records. The header is displayed for editing in a set of forms on different tabs all managed by a ValuesManager. Existing details are shown on another tab in a ListGrid which allows the editor to do inline edits in the grid. When the user clicks save I need to save any pending edits they may have made in the detail grid and if those saves were successful I then need to save the header record.

    Is there a recommended pattern to follow in this situation? ListGrid.saveAllEdits() supports a callback that "will be fired on a successful save." Does that mean the callback will only fire if all of the edited records were saved successfully? If any of them failed due to validation errors does the callback not get fired? How do I know if it is OK to continue with the save of the header?

    #2
    Use saveAllEdits as the indication that you can proceed with the main save; editComplete and editFailed will tell you about partial success and failure if you need to do something beyond the (automatic) display of validation errors.

    Comment


      #3
      Thanks. Those were the APIs I was looking for.

      A related question. I see that the ListGrid does not implement HasHiddenValidationErrorsHandlers. How can I detect on editFailed that the field with errors is not visible? I can see this warning in the dev console but how can I trap and show the error in an warning dialog?

      11:43:36.787:XRP3:WARN:ListGrid:isc_PoItemCanvas_14_2:setRowErrors() passed error for non-visible field: 'IATT01'
      Last edited by jay.l.fisher; 17 Feb 2011, 09:48.

      Comment


        #4
        Currently, there is no separate handler - you would need to use the dsResponse which is available to you on the EditFailedEvent, and compare errors within that response to visible fields.

        Comment

        Working...
        X