Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourBlue
titleIN-progress

In EmpowerID, a newly introduced feature is the Repeater Control. This control distinguishes itself from the conventional empowered controls visible upon clicking any field, entering the edit mode, and accessing the controls tab, where a list of controls is traditionally displayed. Instead, the Repeater Control serves as a technique for rendering sections repeatable, providing users with a distinct technique for managing repetitive content.

Key Considerations for Repeater Control

a) On your repeater control, you have the Add New Item button. Using this button, you can add a new item to the repeater. If you want to modify the text on this button, you can do so. The text on the button can be localized as well.

Image Removed

b) Do Not Show in Add New: If this property is checked on any field, that field will not appear after you click on the 'Add New Item' button. Instead, the field will only appear in the first item or row.

Image Removed

c) Do Not Show in Grid: If this property is checked on any field, that field will not appear in the Grid

Image Removed

Here are the steps to create a Repeater control

and

or make sections repeatable:

  1. On your Form go to the Data Sources right click on it and select Add Data Source option.

  2. The Add New Data Source dialog box will appear. From there, select the Create New Data Source option and click on the Next button.

  3. Enter any name in the Data Source Name textbox. From the DataSource Type dropdown, select the Static option. In the Static Type List field, provide the name of your component view that you want to bind with the Repeater Control or Section. Click on the Finish button.

  4. Once your Datasource of type Static is created right click on it and select the Create List Object for this DataSource option

  5. An object will be created, namely ListObject1. Double-click on it and rename it to your preferred name, for example, ListObjectAddress.

  1. Save and close your form, then reopen it so that all the attributes of your static DataSource can be loaded correctly.

  1. Now right click on the section and click on the edit option.

  2. A Selection Configuration dialog box will appear. To make your Section repeatable, select your static data source from the Repeating Datasource dropdown. The next important property is the Repeating Parameter Prefix; type any meaningful name into it. Click on the Ok button.

Info

Repeating Parameter Prefix: In this property, you provide the value to prefix your repeater control. This means that in the code behind or backend, if you want to access your repeater control, you would have to use this property’s name.

  1. Now drag and drop the fields onto your section that you want to display in a repeater control. In our example we have dropped Name, Description and City fields.

  2. Publish your form and restart the workflow when asked because we have already learned in our previous sessions that we need to restart the workflow studio when we publish our form for the first time.

  3. Now create a workflow and drag and drop your Form activity onto the Workflow Designer pane. Select it, and in the Properties tab, go to the Name property and give it any name, for example, RPTAddressForm.

  4. Drag and drop the System Code Activity onto the Workflow designer pane, give it any name (for example, SCA), double-click on it, and write the following code in its Implement method.

    Code Block
    //CurrentWorkflow.HereComesTheNameOfYourForm.HereComesTheNameOfYourDatasource With DataSource_Static = C.YourComponentName.GetAll();
    CurrentWorkflow.HSRpt.dsAddressDataSource_Static = C.Address.GetAll();
  1. Connect your System Code Activity with the Form Activity with the help of a line originating from the Start circle and ending at the End circle.

  2. Publish your Workflow first from the Workflow Studio and then Publish it in the UI and run it to see how a repeater control looks like in the UI.

Key Considerations for Repeater Control

a) On your repeater control, you have the Add New Item button. Using this button, you can add a new item to the repeater. If you want to modify the text on this button, you can do so. The text on the button can be localized as well.

b) Do Not Show in Add New: If this property is checked on any field, that field will not appear after you click on the Add New Item button. Instead, the field will only appear in the first item or row.

c) Do Not Show in Grid: If this property is checked on any field, that field will not appear in the Grid but just only on the first item or row

Now I have enabled Do Not Show in Add New on my Name field and Do Not Show in Grid on my City field and I have localized my Add New Item button this is how my repeater looks like

Now, I have enabled Do Not Show in Add New on my Name field and Do Not Show in Grid on my City field. Additionally, I have localized my Add New Item button. This is how my repeater looks now.