cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

EnumMultiReferenceEditor is giving error

abhinavsingh11
Participant
0 Likes
931

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

abhinavsingh11
Participant
0 Likes

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

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes

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

abhinavsingh11
Participant
0 Likes

,

But how would I filter on a DemoEnum value. DemoEnum is added as a attribute to another item type.

I want to filter showing Enum values based on some condition. how should I achieve this usecase?

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes

Hm, can you please elaborate a bit further?

  • do you want to filter the values shown in the dropdown?

  • do you want to search OtherTypeThatShouldHaveListOfDemoEnums by DemoEnum?

Unfortunately, I don't really understand your problem / use case

abhinavsingh11
Participant
0 Likes

Yes. I want to filter the values shown in the dropdown.

former_member682593
Participant
0 Likes

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

abhinavsingh11
Participant
0 Likes

Without editor attribute I won't be able to use EnumMultiReferenceEditor. I tried by adding type and without Type.

I already have DemoEnum attribute in my items.xml