Sorting binded documents in Composed Form Model

Hi @gunther-stable-thorn,

the sample code (or example) from which I was talking about in this post is available in the ticket A12-16010. Since I assume that you don’t have access to the ticket, I will copy the relevant part in this thread:


The customization option has already been avaiable via an API called “componentProvider”, the API itself is already a public interface and can be imported by anyone. However, the current implementation of Relationship Engine doesn’t allow an “simple” way to register and override certain component like “DualPane” or “TableList” components. Therefore, the design of solution will be aimed to exposing it as minimal as possible so that the project won’t experience unintended breaking changes causing by the “experiemental” CDM.

Instead of

const CustomFormModelMap: FormModelMap = {
	...DefaultFormModelMap,
        ...DefaultRelationshipFormModelMap,
}

The FormModelMap now can be registered via createRelationshipFormModelMap with an optional “componentProvider”

const CustomFormModelMap: FormModelMap = {
	...DefaultFormModelMap,
	...createRelationshipFormModelMap({
		componentProvider: config => {
			if (config.name === "DualPaneSelection") {
				return { type: "MultiSelection", component: CustomDualPane };
			}
			return undefined;
		}
	})
}; 

This allows CustomDualPane or TableList to be override-able and provided a new list with custom sorting.