Expand my Community achievements bar.

Extending foundation/components/forms/*

Avatar

Level 1

Hi everyone,

We had extended some of the form components, primarily to extend the styling of the default components and adjust scaffolding.  However, we've realized recently that validation is now failing.  This appears to be due to broken inheritance in the form components themselves.

Using foundation/components/forms/text as the example, there is no sling:resourceSuperType for the text component itself, the sling:resourceSuperType is applied via edit config (which is more of an Apache Sling development practice than AEM), rather than applying sling:resourceSuperType via .content.xml.

What's happening in this case is that since we've extended our own form component in project/components/form/text with a resourceSuperType of foundation/components/form/text, we're getting a "second" sling:resourceSuperType applied via the content node.

I guess the primary question here is, why doesn't foundation/components/form/text have a sling:resourceSuperType of foundation/components/form/defaults/field instead of applying the resourceSuperType to the content node?

Secondary question is, what is the proposed method to extend these foundation form components without further breaking inheritance in a multi-tenant environment?  We don't want to overlay foundation/components/form/* in /apps since each project may have a different implementation, and we'd like to inherit hotfixes and upgrades from /libs.  It seems as though the only option is to copy the whole foundation/components/form structure verbatim and create an orphaned implementation for each multi-tenant site... unless there's a different approach that I'm not seeing.

The documentation explains how to add constraints, etc. But not how to extend the existing form components:

https://docs.adobe.com/docs/en/aem/6-2/develop/components/developing-forms.html

2 Replies

Avatar

Administrator

Moving this question to "AEM Forms" topic. So that contextual experts can help you better.

~kautuk 



Kautuk Sahni

Avatar

Level 1

Hi @kautuksahni,

This was an AEM Sites question not a Capital-F AEM Forms / LiveCycle question, unless they happen to be maintained by the same people.