Adding items on multifield at top? | Community
Skip to main content
kennyhank
New Participant
February 6, 2017
Solved

Adding items on multifield at top?

  • February 6, 2017
  • 3 replies
  • 1550 views

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.
Best answer by Peter_Puzanovs

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

March 27, 2018

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

kennyhank
kennyhankAuthor
New Participant
February 6, 2017

Hi Peter,

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

Thanks you very much.

Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
February 6, 2017

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