on 10-14-2016 10:38 AM
I wanted to edit the enum attribute of RotatingImagesComponent in smartEdit 6.1.0.2. I followed the following steps:
Extended the Structure API : Used ""enumComponentTypeAttributePopulator" type component attribute populator for the Enum attribute.
Extended the Component API : Created a new bean class for RotatingImagesComponent and declared the property type as "de.hybris.platform.cmswebservices.data.EnumData" for Enum property. Also, created the model populator and data populator for the component.
While editing this component in smartEdit, I am getting the "Required String parameter 'enumClass' is not present error" error on loading of content editor. (Please see the attached screenshot).
Also, only the current value of Enum attribute is shown in dropdown window instead of all the enum type values.
Hi Tarun,
For enums, OOTB cmswebservices already defines an "enumComponentTypeAttributePopulator" as follow:
<bean id="enumComponentTypeAttributePopulator" class="de.hybris.platform.cmsfacades.types.populator.CmsStructureTypeComponentTypeAttributePopulator">
<property name="cmsStructureType" value="Enum" />
</bean>
The next steps for you would be to expose the enum component type:
Excerpt from Extending the Structure API: Exposing Your New Component Types
To expose your new component types, you must do the following:
- 1. Declare a component type structure.
- 2. Declare a component type attribute structure.
For your case, you might be interested in returning the enum value and label. This could be done by returning a list of OptionData as described in the "Exposing Additional Component Type Attribute Properties" section.
Excerpt from Extending the Structure API: Exposing Your Additional Component Type Attribute Properties
- Step 4: Create ComponentTypeAttribute Populator
- Step 5: Register the Property Populator
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.