Change repeat footer buttons if screen is readonly

Hello everyone,

I created a form model (see attachments) with an detached repeat where the fields of a repeat entry will be readonly if all fields are filled via dependent fields/groups. When I open an entry with only readonly fields the footer buttons cancel/commit are still displayed but not the close button, which would make more sense here.

How can I achieve that these buttons are not displayed but a close button? Is that possible with just modelling?

Person_DM.json (5.4 KB)
Person_FM.json (8.1 KB)
Person_OM.json (2.5 KB)

Hello @daniel-radiant-elm,

I have a question, I did take a look into your models, and you are talking about embedded Repeats? But as I can see, you modeled a Detached Repeat? Is this right?

For Detached Repeats, it is not possible to model those buttons, since the Buttons for the detached Repeat Screen are hard-wired and can not be changed by a modeler.

But maybe we can have a workaround? Could you please explain what your desired Repeat looks like? How does those fields get filled (Backend)? Because currently, if an end user is filling out those field, they get read-only and can’t be changed anymore? Is this desired? Or do those fields get filled out by some API?
Are there fields within the repeat which should be edible? Or are all fields within the repeat read-only if those fields are filled out?

Hello @svenja-still-dawn,

yes, I am using detached repeats. The fields are readonly which is correct and the user cannot change that anymore. But the footer buttons “Commit” and “Cancel” suggest that the user could still change something. From a technical point of view, this is not a problem because both buttons will just close the detached repeat entry. But from UI/UX point of view this could mislead the user to think, he could change something. Therefore the goal is to remove these buttons and add a simple “Close” button if all fields of the detached repeat entry are readonly.

In our project the fields will be readonly via dependent field/group configuration and the backend will fill out the master field. So after it’s readonly, the user will not have the opportunity to change these fields of the detached repeat entry again. There are no fields which the user could change in this state.

We use this for a “send e-mail” feature. The user can put all information in the detached repeat entry for the e-mail and then send the email via a button. After the email is sent successfully, all fields are readonly.

We have found a solution that is close to our desired behaviour. In [Settings → General Detached Repeat Settings] we set “No data change in detail screen” to “Hide Button”. No the detail screen of the detached repeat with only readonly fields can never have a “Commit” button because the user cannot edit anything. On screens with non-readonly fields, the “Commit” button is only shown, if the user edits something. It is not exactly what we wanted, but it is good enough for our use case.