Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Prepopulate Values in pathfield in a multifield dialog

CQ_learner
Level 4
Level 4

Hey Guys,

I want to prepopulate values in a pathfield which is inside a multifield in a dialog on the page load. The values I want to populate is from the list of pages i created under a certain node, I have these values from the backend Servlet which is called on page load. Also we have the restriction of having only 10 multifield values in the dialog. Can you please guide me on this? We also have the requirement to handle this is in AEM5.6.1, AEM 6.0 and AEM 6.1.(touch UI).

Thanks in Advance!

1 Reply
smacdonald2008
Level 10
Level 10

For this use case, you will need to code JS logic using Granite APIS. For example: 

CUI.Multifield = new Class({
        toString: "Multifield",
        extend: CUI.Multifield,
       ...

TO programmatically work with Granite data types, .see Granite UI’s documentation.

We have a community article that shows you how to work with a Multifield control in TOuch UI and an example of coding with Grainte APIs. It will point you in the right direction:

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

Also notice this event handler in the code: 

 $(document).ready(function () {
        addDataInFields();
        collectDataFromFields();
    });

 

Kuanqi
Level 2
Level 2

I need do same thing use classic ui in CQ 5.5, how can I do it?

Naresh_Katkam
Level 2
Level 2

for CQ5.5 write a load content event js to prepopulate values.

edubey
Level 10
Level 10

Hi CQ_learner

What would be the purpose of populating them in dialog via servlet. Once populated, you will be showing them on page...right?

Why don't you directly show them on page via servlet.

Let me know if my understanding in wrong...

Thanks