Repeatable section - RepeatableSection

A set of fields that can be filled multiple times in the application by the user.

Component properties

Eximee Designer property
Attribute name in Source
Description

Minimum number of section occurrences (section Basic properties)

minCount

Minimum number of occurrences of the repeatable section (initial value 1). At the time the application is displayed, this is also the number of occurrences that are visible and available by default. When removing section items while filling out the application, you cannot go below this number.

Maximum number of section occurrences (section Basic properties)

maxCount

Maximum number of occurrences of the repeatable section (initial value 1). When adding section items you cannot exceed this number.

Title (section Basic properties)

title

Title.

The availability of features depends on the license and may not be available in all deployments.

Title of the entire repeatable section (section Basic properties)

parentSectionTitle

Title for the entire repeatable section.

Label for the collapse section button (section Other)

Label for the collapse section button.

The availability of features depends on the license and may not be available in all deployments.

Label for the expand section button (section Other)

Label for the expand section button.

The availability of features depends on the license and may not be available in all deployments.

Foldable section (section Other)

foldable

Specifies whether the section should be foldable (initially set to "false").

The availability of features depends on the license and may not be available in all deployments.

Section fold condition (section Other)

foldedCondition

Condition for folding the section.

Feature availability depends on the license and may not be available in all deployments.

Presentation method of section expansion (section Other)

presentation

Specification of the method of presenting section expansion. Available types of collapse/expand presentation: STANDARD and LABELS (see broader description below).

The availability of features depends on the license and may not be available in all deployments.

Dynamic button labels (section Other)

plusMinusLabels

Conditions for the visibility of the add/remove buttons for repeatable section items.

Label for the delete section button (section Other)

minusText

Label for the minus button (removal of a repeatable section item).

Label for the add section button (section Other)

plusText

Label for the plus button (adding a repeatable section item).

Title of the expanded section (section Other)

rowTitleExpanded

Title displayed for the expanded section.

The availability of features depends on the license and may not be available in all deployments.

Title of the collapsed section (section Other)

rowTitleCollapsed

Title displayed for the collapsed section.

The availability of features depends on the license and may not be available in all deployments.

Component border (section Other)

parentSectionFrameVisible

Setting the flag causes a frame to be displayed around all occurrences of the repeatable section (initially set to "false").

The availability of features depends on the license and may not be available in all deployments.

Offset value for the add button (section Other)

plusButtonOffset

Offset value for the add button (initially set to 0).

The availability of features depends on the license and may not be available in all deployments.

Tooltip for the delete button (section Other)

minusToolTipText

Tooltip for the row delete button

More information about component properties: Common component properties

Working with a repeatable section

Placing a repeatable section on the application template adds an area that can be worked with similarly to the entire application. This means that this area has its own page layout and may contain any number of base components. In the example in the figure, the repeatable section occurrence was configured as a composite consisting of a text field and choice fields with labels. The plus/minus sign in the lower right corner is used to add additional section rows.

In the resulting application, occurrences of the repeatable section are displayed according to the configuration. The user can remove or add occurrences by using the minus and plus.

Illustration 1. Example appearance of the component on the form

Populating a repeatable section with a service

It is recommended that when creating a ServiceProxy you inherit from the class AbstractRepeatableServiceProxy. This class automatically returns 3 values: minCount, maxCount and count. These values can be set or left alone — they are optional.

Example ServiceProxy:

  • It has 2 input fields added,

  • It has 2 additional output fields added (minCount, maxCount, count are added in the superclass),

  • To set the parameters you only need to call the appropriate setters on the model RepeatableSectionMetadata and

  • After setting the above parameters, we set the values that we will then map to individual fields.

RepeatableTestSp.java
@Component
@Service(AbstractServiceProxy.class)
public class RepeatableTestSp extends AbstractRepeatableServiceProxy {

    public RepeatableTestSp(String name, String description) {
        super("RepeatableTestSp", "Description...");
        this.inputFields.add(new ServiceProxyField("input1"));
        this.inputFields.add(new ServiceProxyField("input2"));
        this.outputFields.add(new ServiceProxyField("output1"));
        this.outputFields.add(new ServiceProxyField("output2"));
    }

    @Override
    protected RepeatableSectionMetadata callRepeatableSectionService(
            Map<String, List<String>> requestParams, String lang) throws ServiceProxyException {
        final RepeatableSectionMetadata repeatableSectionMetadata = new RepeatableSectionMetadata();
        repeatableSectionMetadata.setMinCount(1);
        repeatableSectionMetadata.setMaxCount(10);
        repeatableSectionMetadata.setCount(5);
        repeatableSectionMetadata.setRepeatableSectionRows(createRows());
        return repeatableSectionMetadata;
    }

    private List<Map<String, String>> createRows() {
        final List<Map<String, String>> rows = new ArrayList<>();
        rows.add(createRow());
        rows.add(createRow());
        return rows;
    }

    private Map<String, String> createRow() {
        final Map<String, String> map = new HashMap<>();
        map.put("output1", "1");
        map.put("output2", "abc");
        return map;
    }
}

To use the above ServiceProxy, in externalDataSource the type should be REPEATABLE_SCECTION_SERVICE.

In summary: the service added 2 rows, but set the count value to 5. Therefore 5 rows will be displayed, of which only 2 will be filled with the mapped value from the endpoint output1.

There is also the possibility to populate the repeatable section with a script.

Demo applications:

  • demoRepeatableSection

  • repeatable_section_service (an application showing populating the section with a service or script)

  • demoRepeatableSectionValidator (an application with a validator for repeating values in the section)

Last updated

Was this helpful?