Skip to main content

GenericMultiple

Purpose

The GenericMultiple ViewTemplate displays and edits multiple datasets of the same relation in a column-based layout. It is especially useful on the n side of a 1:n relationship when users need to add or edit several related records in one place.

GenericMultiple Figure: GenericMultiple used for editing multiple related records.

Behavior

Each row represents one dataset. Additional rows can be created dynamically by using the plus button. The ViewTemplate is primarily intended for Edit Views.

tip

Use GenericMultiple mainly in Edit Views to provide a predictable editing workflow.

Configuration

The displayed fields are defined through the columns property. The label of the ViewTemplate is controlled by the title property. If no explicit title is configured, the title of the underlying Entity is used.

EntityFields with content type HTML are rendered as rich-text fields using the HTML editor.

An example configuration in Communication_entity from module contact uses the following columns:

  • MEDIUM_ID
  • ADDR

Example usage

An example is the ViewTemplate MultipleEdit in CommunicationMultiEdit_view, which is referenced by OrganisationEdit_view.

In the ADITO client, it appears when creating a new company under Contact Management > Company. The ViewTemplate allows the user to add multiple communication entries, such as email addresses, and to create additional rows via the plus button.

Advanced example

The ViewTemplate can also be used in more complex scenarios, for example in an Action that assigns multiple persons to a campaign.

For such an implementation, one Entity can be used to control the input ViewTemplate, while another Entity handles persistence. The input Entity typically defines fields such as UID and CONTACT_ID, uses a suitable Consumer, and provides a JDitoRecordContainer for the temporary input data.

The saving Entity can then process the inserted rows and write them to the target table in an onActionProcess, for example by reading $field.Participants.insertedRows and creating the required database inserts.

It is also possible to implement GenericMultiple within a single Entity. One example in xRM is the context VisitRecommendationNewVisitplanEntry, where Consumers and Providers of the same Entity are combined for this purpose.