Expand my Community achievements bar.

SOLVED

Parent child component dialog value dynamically AEM 6.4

Avatar

Level 1

Hi Team,

 

 I have a requirement where i want to use parent component dialog value in the child component dialog dynamically. 

 

Suppose i have text dialog in parent component, once i provide the text value that should automatically populate in child component dialog. 

 

any clue how to do this? 

 

Regards

Nishant 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hey,

While saving the content in parent node, can't you create a child node and save the same values with the property name of child component?

Let's say - once you open a parent component dialog and save the values. so in the getter or some other way, you can take those values and create a child node structure having property resourcetype -> which is nothing but you child component path and properties of that child component dialog.

 

so once you'll open the dialog, you will see the values.

 

Thanks!

View solution in original post

5 Replies

Avatar

Community Advisor

Hey,

I think you should not use the term "automatically populate in child component dialog". other way, you can do this by sling models by fetching the value and set it to child component property.

so once you will open the dialog, you'll find the value associated with it.

 

Cheers!

Avatar

Level 1

Thanks All for quick reply, 

Let me help with the scenario. 

I have 2 component A(Parent) and B (Child) , Parent component having two dialog field suppose username and password text type . Now once Author update username and password, Child component should pick these two-field value automatically in dialog. Frontend prospective what will be the approach on this . 

Avatar

Correct answer by
Community Advisor

Hey,

While saving the content in parent node, can't you create a child node and save the same values with the property name of child component?

Let's say - once you open a parent component dialog and save the values. so in the getter or some other way, you can take those values and create a child node structure having property resourcetype -> which is nothing but you child component path and properties of that child component dialog.

 

so once you'll open the dialog, you will see the values.

 

Thanks!