Expand my Community achievements bar.

SOLVED

Adding items on multifield at top?

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 3

Hi Peter,

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

Thanks you very much.

Avatar

Former Community Member

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