Has anyone got a chance to extend an AEM Forms Component? for eg. File Attachment Component | Community
Skip to main content
Level 3
January 14, 2022
Solved

Has anyone got a chance to extend an AEM Forms Component? for eg. File Attachment Component

  • January 14, 2022
  • 1 reply
  • 1430 views

AEM v. 6.5.8

I tried using resourceSuperType like we do for normal AEM component but it just breaks the form.

sling:resourceSuperType="fd/af/components/guidefileupload"

Getting the following error on console:

guideRuntime.min.js:1082 TypeError: Cannot read properties of undefined (reading 'priority')
at getAttribute (VM1484 guideRuntime.min.js:624:448)
at get (VM1484 guideRuntime.min.js:645:118)
at g._collectExpressions (VM1484 guideRuntime.min.js:632:279)
at g.initialize (VM1484 guideRuntime.min.js:631:359)
at g.initialize (VM1484 guideRuntime.min.js:869:153)
at g.c.ut.Class (VM1484 guideRuntime.min.js:14:187)
at g [as constructor] (VM1484 guideRuntime.min.js:13:120)
at g [as constructor] (VM1484 guideRuntime.min.js:13:120)
at g [as constructor] (VM1484 guideRuntime.min.js:13:120)
at new g (VM1484 guideRuntime.min.js:13:120)
e.model.fireOnContainerDomElementReady @ guideRuntime.min.js:1082
window.guidelib.__runtime__.target.loadExperience @ test2.html?wcmmode=preview:941
(anonymous) @ test2.html?wcmmode=preview:949
guideRuntime.min.js:1076 Uncaught TypeError: Cannot read properties of undefined (reading 'runtime')
at Object.e.model.mergeData (VM1484 guideRuntime.min.js:1076:164)
at Object.e.model.fireOnContainerDomElementReady (VM1484 guideRuntime.min.js:1082:493)
at Object.window.guidelib.__runtime__.target.loadExperience (test2.html?wcmmode=preview:941:39)
at test2.html?wcmmode=preview:949:48

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Tiwari

You could customize the File attachment component as other AF components using the widget framework. as explained in the link below:

https://experienceleague.adobe.com/docs/experience-manager-64/forms/customize-aem-forms/custom-appearance-widget-adaptive-form.html?lang=en

 

Thanks,

Mayank

1 reply

Mayank_Tiwari
Adobe Employee
Mayank_TiwariAdobe EmployeeAccepted solution
Adobe Employee
January 17, 2022

You could customize the File attachment component as other AF components using the widget framework. as explained in the link below:

https://experienceleague.adobe.com/docs/experience-manager-64/forms/customize-aem-forms/custom-appearance-widget-adaptive-form.html?lang=en

 

Thanks,

Mayank

Level 3
January 18, 2022

The reason why I want to extend the component was to add some default support types to the file attachment component. So that whenever I use file attachment component It should already include all the mime types which I require. is this possible in the above? because what i got from the link was to chnage the appearance of the component is possible.

Level 3
January 18, 2022

Can you use something like this:

 

 


This will work If I want to restrict the uploads.
Again sorry for not sharing this earlier, What I'm trying to achieve is that when user clicks on attach button a file explorer should open and by default some file types should be visible.
So, I'm not adding the file types just to verify the uploads but the main agenda is to have those files already visible on the explorer window when attach button is clicked.