Skip to Content

EnumMultiReferenceEditor is giving error

Hi,

We have a enum DemoEnum for which we want to filter out the values from enum based on condition for which we are using EnumMultiReferenceEditor as follows:

 <editorArea:attribute qualifier="demoStatus" label="customersupport_backoffice_tab_customer_enrollments_label_demoStatus" type="EnumMultiReference-LIST(DemoEnum)" editor="com.hybris.cockpitng.editor.enummultireferenceeditor"/>

However, when I run it , it gives error popup as Improper value type: java.lang.Enum(DemoEnum)'].

I even followed configurations given at:

https://help.hybris.com/1808/hcd/8bab6c4486691014a3899cab8989d996.html

But I cannot get what I am doing wrong. Please help.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Oct 18, 2018 at 12:48 PM

    Type of demoStatus is DemoEnum

    How should this ever work? You can not store a collection into a single valued attribute

    Change your typesystem ( items.xml) accordingly, preferably add a <relation> with the appropriate cardinality (most likely many-to-many) between DemoEnum and OtherTypeThatShouldHaveListOfDemoEnums

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2018 at 12:24 PM

    To filter on the values of an enum we can add a editor-parameter "availableValuesProvider" and add a spring bean as it's value

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2018 at 12:44 PM
    -1

    Try without the 'type' and 'editor' attributes, they are resolved automatically from the type system. Also please add the DemoEnum definition from your *-items.xml

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.