Customize "Commit" Button on Detached Repeat

Hi guys,

we are using A12 in the version 2023.06-ext4.

In one of our forms, we are using a Detached Repeat. Our goal is that when adding a new repeat entry the “Commit” button not only adds the new entry to the repeat, but also saves the document.

Is it possible to customize the “Commit” Button according to our needs?

From what we have seen so far, the components from the form-model-map, in this case for the EventButtons, are not being used inside the Detached Repeat itself.

Maybe we miss something here and someone has had this problem before and can help us?

Hi,

if I understand you correctly, you want to customize the behavior of the commit button (and not the button itself).

If thats the case, you might be able to use a custom DispatchConfiguration in your form engine. Please see here for an example in the documentation.

Here, the event action to customize would be

Events.Repeat.leaveDetachedRepeatRow({ cancel: boolean })

where the state of cancel signals whether the commit or the cancel button was clicked to close the row.

Hi @chris-long-packet,

thank you for the response and pointing out the leaveDetachedRepeatRow action!

I was able to just listen to the action in a middleware and from there on save the document.

Many thanks for your help!