MetadataFormElementRegistry
Object forms are used to render and edit metadata of DMS objects. Each property of an object can be rendered in a diffenrent way, depending on the type of the property. This service allows to register and retrieve templates for rendering these form elements.
You can register templates for different situations like EDIT, SEARCH, and CREATE. The templates will then be used to render the form elements in the object form component.
So based on the property type you can register custom templates for rendering certain form elements. This is useful if you want to render a property in a different way.
Example: Having a number property representing a rating, you might want to render it as a list of stars instead of a simple input field.
Properties
Section titled “Properties”NAME_PROPERTY_PREFIX
Section titled “NAME_PROPERTY_PREFIX”Type: string
Default Value: '@name:'
Methods
Section titled “Methods”_addDefaultElementTemplate
Section titled “_addDefaultElementTemplate”Register default form element component. Usually this will be done by the object form component itself.
_addDefaultElementTemplate(propertyType: string, templateRef: TemplateRef<any>): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| propertyType | string | |
| templateRef | TemplateRef<any> |
_removeDefaultElementTemplate
Section titled “_removeDefaultElementTemplate”Remove a registered default form element.
_removeDefaultElementTemplate(propertyType: string): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| propertyType | string |
addElementTemplate
Section titled “addElementTemplate”Register an object form element for a certain internal type. You might add a new component or overwrite an existung one.
addElementTemplate(propertyType: string, templateRef: TemplateRef<any>, situation: Situation): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| propertyType | string | |
| templateRef | TemplateRef<any> | |
| situation | Situation |
getElementTemplate
Section titled “getElementTemplate”Get a template to render a certain form element
getElementTemplate(propertyType: string, situation: string): TemplateRef | undefinedArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| propertyType | string | |
| situation | string |
removeElementTemplate
Section titled “removeElementTemplate”Remove a registered form element.
removeElementTemplate(propertyType: string, situation: Situation): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| propertyType | string | |
| situation | Situation |