Adding items on multifield at top? | Community
Skip to main content
kennyhank
Level 3
Feb 6, 2017 3:49 PM UTC
Solved

Adding items on multifield at top?

Hello community, using multifields on our dialogs is very useful, but sometimes when you have one with many items, its hard to add an item and up it to the top of the list on the multifield, because the normal behaviour of the button is insert a new item at the end. Is possible have two buttons add, one for adding at top and the other for adding on bottom? Someone used this before? I did a research about on the multifield widget but I couldn't find a solution for this.
I would be grateful for any help with this.

Regards.

K.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
Feb 6, 2017 4:39 PM UTC

Hey K,

It is possible to add any wonderful modifications you wish to do by overlaying[1] existing AEM components.

In your case, you possibly want to overlay /libs/granite/ui/components/foundation/form/multifield/render.jsp as well as add a bit of extra javascript logic for the new button to pre-pend elements to mutli-field instead of existing append.

[1] https://docs.adobe.com/docs/en/aem/6-0/develop/platform/overlays.html

Hope it helps!

Regards,

Peter

3 replies

Mar 27, 2018 10:02 AM UTC

Hi,

did you had a chance to implement this? if so could you kindly share me info as to how to do it. i have a similar requirement to be done.

in multifield

1. whenever i click "add item" new item should be added at top and not at bottom.

2. also place "add item" button at top and not at bottom of the items.

Thanks

Translate
kennyhank
kennyhankAuthor
Level 3
Feb 6, 2017 5:23 PM UTC

Hi Peter,

I'll going to test this asap, and make the needed modifications for my own multifield behaviour.

Thanks you very much.

Translate
Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
Feb 6, 2017 4:39 PM UTC

Hey K,

It is possible to add any wonderful modifications you wish to do by overlaying[1] existing AEM components.

In your case, you possibly want to overlay /libs/granite/ui/components/foundation/form/multifield/render.jsp as well as add a bit of extra javascript logic for the new button to pre-pend elements to mutli-field instead of existing append.

[1] https://docs.adobe.com/docs/en/aem/6-0/develop/platform/overlays.html

Hope it helps!

Regards,

Peter

Translate