Search code examples
javacontent-management-systemmagnolia

Magnolia CMS - How to reset selected value using LinkFieldDefinition?


I'm trying to implement detail application with with one form field type of LinkField. The field definition looks like below:

  - name: someProperty
    targetWorkspace: some-workspace
    valueProperty: name
    labelProperty: name
    appName: some-app
    path: /
    class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
    identifierToPathConverter:
      class: info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter

And the result looks like:

enter image description here

The problem is I cannot find a way to reset this field after the value has been chosen. Is there any additional option that enables deleting chosen value?


Solution

  • It is not meaningfully possible but a potential workaround is to remove the "pathToLinkedItem" and save the dialogue. Indeed, this overrides the existing value.

    Cheers,

    Hope That helps,