ClientEval with dynamic configuration properties


(Erich Manser) #1

I would like to show or hide a property in my node configuration, depending on a selected value in an other property of the same node. So I went after the documentation of: https://neos.readthedocs.io/en/stable/CreatingASite/NodeTypes/DynamicConfigurationProcessing.html

For my testing I now have two groups: details and duration. Both exist and when I just set group to one of them, everything is fine. But ClientEval somehow does nothing:

detailsDefinition:
  type: string
  defaultValue: 'noDetails'
  ui:
    reloadPageIfChanged: true
    inspector:
      group: details
      position: 10
      editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
      editorOptions:
        values:
          'noDetails':
            label: 'keine weiteren Details'
          'linkDetails':
            label: 'Link zu einer Seite'
          'eventObject':
            label: 'Direkte Eingabe'
          'download':
            label: 'Download'
linkDetails:
  type: string
  ui:
    label: 'Interne Seite'
    inspector:
      group: 'ClientEval:node.properties.detailsDefinition == "linkDetails" ? "details" : "duration"'
      position: 20
      editor: 'Neos.Neos/Inspector/Editors/LinkEditor'

What could be the problem?


(Dmitri Pisarev) #2

The problem is in wrong documentation, there’s a long-standing PR to fix, which still hasn’t been merged: https://github.com/neos/neos-development-collection/pull/2182/files
In essence you should use “ui.inspector.hidden” to hide the property.


(Erich Manser) #3

Wow, you answered the same day and I didn’t recognize it until now. Shame on me!

Yes, that did trick:
hidden: ‘ClientEval:node.properties.detailsDefiniion==“linkDetails”’

Thx!!!