Expand my Community achievements bar.

SOLVED

Is it possible to add another option type to Core Form Options?

Avatar

Level 2

In the AEM Core Form Option component, the authoring dialog has a dropdown for option 'type'.  Out of the box, the available options are 'Checkboxes, Radio buttons, Drop-down, and Multi-select dropdown'.  Is it possible to add a custom option to this list (like a group of buttons)?

 

It is easy enough to change the authoring dialog to offer the option, but the Sling model implements the following Options interface that defines an enum for possible values:  

 

dms879090_0-1677876667064.png

Is it possible to add a custom enum value (like BUTTON_GROUP) without changing the source code? I tried extending the OptionsImpl class, which is the sling model that uses this interface, but I can't override its getType() method that returns the interface's enum Type to return my own enum with the new value

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @dms879090 ,

 

AEM Forms Core Component relies on the AEM Sites Core Components IMO, you should follow delegation pattern to customize it. eg . https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models

https://kiransg.com/2021/11/07/aem-core-component-delegation/

 

Also, I would post this question to community which is dedicated to AEM Forms here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/ct-p/adobe-experienc...

 

Hope that helps!

Regards,

Santosh

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @dms879090 ,

 

AEM Forms Core Component relies on the AEM Sites Core Components IMO, you should follow delegation pattern to customize it. eg . https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models

https://kiransg.com/2021/11/07/aem-core-component-delegation/

 

Also, I would post this question to community which is dedicated to AEM Forms here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/ct-p/adobe-experienc...

 

Hope that helps!

Regards,

Santosh