Customize Remove Button in Orbeon Builder Repeatable Sections
Learn how to customize the remove button label in Orbeon Builder for repeatable sections. Change 'Remove line' to context-specific text and localize for multiple languages.
How can I customize the ‘Remove’ button label in Orbeon Builder for repeatable sections? I need to change the default text like ‘Remove line’ to context-specific text such as ‘Remove person’. While Orbeon 2022.1 allows customizing the ‘Add’ button label, I don’t see an option for the ‘Remove’ button. Is there a way to achieve this with or without custom development? Additionally, can these custom labels be localized for different languages?
Yes, you can customize the Orbeon Builder remove button label for repeatable sections, changing defaults like “Remove line” to something contextual like “Remove person”—but it requires editing the form’s XML source, unlike the GUI option for “Add” buttons. This works in Orbeon 2022.1 and later without heavy custom development, just careful tweaks in Builder’s source view. And yes, these labels fully support localization across languages through form resources.
Contents
- Understanding Repeatable Sections and Default Buttons in Orbeon Builder
- GUI Customization for Add Buttons in Repeatable Sections
- Customizing the Remove Button Label via XML Source Edit
- Step-by-Step Implementation for Remove Label Changes
- Localizing Custom Remove Labels for Multiple Languages
- Limitations, Best Practices, and Alternatives
- Sources
- Conclusion
Understanding Repeatable Sections and Default Buttons in Orbeon Builder
Repeatable sections and grids in Orbeon Forms Builder let users add or delete rows dynamically—think family member lists where “Remove person” makes way more sense than the bland “Remove line.” By default, though, Orbeon sticks to generic labels: “Add another” or a plus icon for additions, and “Remove” or a trash icon for deletions. These show up differently based on the section’s appearance setting—minimal view gives you a simple “-” button, while full view spells out “Remove.”
Grids behave similarly, often using icons in compact mode, but text labels kick in for larger repeats. The catch? While repeat settings toggle add/remove/move on or off via a checkbox, there’s no built-in field for tweaking remove text. Why the asymmetry? Orbeon prioritizes simplicity in the GUI, saving advanced tweaks for source edits. Frustrated users hit this wall often, especially when context matters—like forms for personnel or inventory.
GUI Customization for Add Buttons in Repeatable Sections
Good news first: customizing the “Add” button is dead simple, no code required. Head to your repeatable section or grid in Builder. Click the section header gear icon to open settings. Under “Repeat,” flip on “Allow add/remove/move repetitions” if it’s not already, then scroll to “Add Repetition Label.”
Type your custom text there—“Add person,” “Add item,” whatever fits. Preview the form, and boom: it updates instantly. Repeated grids follow the same flow, swapping the plus for your words. This ties into dynamic templates too, so labels can pull from instance data if you’re fancy. But remove? Crickets in the GUI. That’s where XML steps in.
Customizing the Remove Button Label via XML Source Edit
No GUI for remove labels means diving into the form source—but it’s straightforward, not “custom development” territory. Orbeon exposes XForms bindings that let you override defaults via form resources. A tried-and-true approach, shared on Stack Overflow, uses a resource reference on the repeat control.
The key? Add a fr:remove-iteration-label attribute pointing to your custom resource, like ref="$form-resources/my-section/remove-label". This pulls localized text without hacking core properties. Works for both sections and grids in 2022.1+, and it’s per-form, so no server-wide changes. Dynamic bonus: labels can incorporate the current iteration number, like “Remove person {position()}.”
Step-by-Step Implementation for Remove Label Changes
Ready to swap “Remove line” for “Remove person”? Here’s the no-fluff walkthrough. Backup your form first—Builder’s source view is forgiving, but mistakes happen.
-
Open your form in Orbeon Builder. Switch to Source View (top toolbar, looks like code brackets).
-
Find the repeatable section or grid—search for
<fr:sectionor<fr:gridwithrepeat="*". It might look like:
<fr:section bind="section-1-bind" repeat="true">
...
</fr:section>
- Add the resource binding right on that element:
<fr:section bind="section-1-bind" repeat="true" fr:remove-iteration-label="ref='$form-resources/section-1/remove-label'">
...
</fr:section>
Tweak section-1 to match your bind ID. For dynamic text: fr:remove-iteration-label="concat('Remove person ', position())".
- Define the resource. Scroll to the
<resources>section (or add one if missing):
<resources>
<resource xml:lang="en">
<section-1>
<remove-label>Remove person</remove-label>
</section-1>
</resource>
</resources>
- Save, publish, and test in Form Runner. Hit preview—your label should appear on the remove link or button.
Grids? Same deal, just target <fr:grid>. If icons persist (minimal view), switch to “full” appearance in section settings. Tested in 2022.1; scales to newer versions seamlessly.
Localizing Custom Remove Labels for Multiple Languages
Localization? Absolutely baked in. Orbeon handles it via XML resources per language—no extra dev needed. In Builder, click the globe icon to add languages (e.g., en, fr, es).
For each, edit the <resources> block:
<resources>
<resource xml:lang="en">
<section-1>
<remove-label>Remove person</remove-label>
</section-1>
</resource>
<resource xml:lang="fr">
<section-1>
<remove-label>Supprimer la personne</remove-label>
</section-1>
</resource>
</resources>
The fr:remove-iteration-label ref pulls the right one based on browser locale. Form Builder’s localization docs cover the full flow, including language selectors. Dynamic labels localize too if your concat uses resources. Users switch languages mid-form? Seamless swap.
Pro tip: Test with Form Runner’s language param (?lang=fr). Covers global teams perfectly.
Limitations, Best Practices, and Alternatives
Not perfect—XML edits bypass GUI previews sometimes, so double-check in Runner. No direct support for super-complex dynamics without XPath wizardry, and toggling repeats off via repeat settings hides buttons entirely as a nuclear option. Properties like oxf.fr.remove.iteration.label don’t exist form-wide; it’s per-form only.
Best practices: Name resources consistently (e.g., {section-bind-id}/remove-label). Use short labels for mobile. For grids in minimal mode, icons rule—force text with CSS if desperate (detail="full"). Alternatives? Custom XBL components for pros, or just live with defaults if UX isn’t critical.
Grid component docs note “Remove” as fallback; override beats it every time.
Sources
- Custom label for remove button in repeatable section/grid — Stack Overflow solution with XML code for overriding remove labels: https://stackoverflow.com/questions/79871938/custom-label-for-remove-button-in-repeatable-section-grid
- Section settings — Orbeon documentation on configuring repeatable section labels and appearances: https://doc.orbeon.com/form-builder/form-editor/section-settings
- Repeat settings — Guide to enabling add/remove repetitions and related toggles: https://doc.orbeon.com/form-builder/form-editor/repeat-settings
- Repeated grids — Details on grid repetition buttons and default behaviors: https://doc.orbeon.com/form-builder/form-editor/repeated-grids
- Section — Form Runner section component defaults including minimal view buttons: https://doc.orbeon.com/form-runner/component/section
- Grid — Grid component labels like “Remove” in different views: https://doc.orbeon.com/form-runner/component/grid
- Localization — How to add and edit resources for multiple languages in forms: https://doc.orbeon.com/form-builder/localization
Conclusion
Customizing the Orbeon Builder remove button for repeatable sections boils down to XML source edits with resource bindings—quick, localized, and way better than generic “Remove line.” Skip the GUI gap by following those steps, and your forms feel tailored, not templated. Dive in today; your users (and sanity) will thank you.