Expand my Community achievements bar.

Convert multifield values to a JS object.

Avatar

Level 4

How can I convert multfield values (Touch UI widget) in to a JS object (AME 6.1)

I am looking to create following JS object from AEM Multi-field:                                                

var fruits = [ { x: 10, y: 10 }, { x: 20, y: 12 }, { x: 30, y: 8 }, { x: 40, y: 14 }, { x: 50, y: 6 }, { x: 60, y: 24 }, { x: 70, y: -4 }, { x: 80, y: 10 }];

 

X,Y will be values from multifield widget

2 Replies

Avatar

Administrator

Hi 

Please have a look at this Helpx article:-

Link:https://helpx.adobe.com/experience-manager/using/htl_multifield.html

// Specifically look at defination of "setItems()" function. This is the place where we are inserting value of Multi-field into Json.

I hope this would help you.

 

PS:- The article contains packages, you can install them and can play with them.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 10

You can extend and experiment with the code that Kautuk pointed you do. You need to write code to perform this use case.