Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use variables in properties.options of SingleSelectDropdown #124

Open
marcelhecker opened this issue Nov 23, 2022 · 0 comments
Open

Comments

@marcelhecker
Copy link

I can't use variables or any expression with ${...} in a SingleSelectDropdown. While it works in labels or placeholders, there seems to be a problem with the options array. Only if I set the properties.options like man = 'Man' it works. Am I doing something wrong or is this an issue?

Example 1:

section1 = Neos.Form.Builder:Section.Definition { 
         required = ${false}
         elements {
                        salutation = Neos.Form.Builder:SingleSelectDropdown.Definition {
                            label = ${Translation.translate('Some.Package:NodeTypes.JobFormular:salutation')}
                            properties.options {
                                man = ${Translation.translate('Some.Package:NodeTypes.JobFormular:man')}
                                woman = ${Translation.translate('Some.Package:NodeTypes.JobFormular:woman')}
                                diverse = ${Translation.translate('Some.Package:NodeTypes.JobFormular:diverse')}
                            }
                            required = ${true}
                        }
           }
}

Example 2:

@propTypes {
        @strict = true
        translation = ${PropTypes.string}
    }

translation = 'test'

...

section1 = Neos.Form.Builder:Section.Definition { 
         required = ${false}
         elements {
                        salutation = Neos.Form.Builder:SingleSelectDropdown.Definition {
                            label = ${Translation.translate('Some.Package:NodeTypes.JobFormular:salutation')}
                            properties.options {
                                man = translation
                                woman = ${translation}
                            }
                            required = ${true}
                        }
           }
}

In all variants the following exception is thrown:

An exception was thrown while Neos tried to render your page
$optionValueField must be provided for array $options

root<Neos.Fusion:Case>/ documentType<Neos.Fusion:Matcher>/ element<Some.Package:Document.Job>/ body<Neos.Fusion:Component>/ content<Neos.Fusion:Join>/ main<Neos.Fusion:Component>/ renderer<Neos.Neos:ContentComponent>/ renderer<Neos.Fusion:Array>/ item_3<Another.Package:Molecule.Section>/ content<Neos.Fusion:Array>/ item_2<Some.Package:Meta.JobFormular>/ renderer<Neos.Form.Builder:Form>/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant