Default Values are not getting displayed when component is drag and dropped

Avatar

Avatar
Validate 1
Level 1
maheswariv26797
Level 1

Likes

0 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
maheswariv26797
Level 1

Likes

0 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
maheswariv26797
Level 1

17-09-2020

Hi,

 

I am pre-populating the multifield values in the dialog using listeners in classic ui. But when i drag and drop the component in the page, those values are not getting displayed. But when i open the dialog and click 'OK', then the values are getting displayed.

 

So what i need to do so that values will be displayed as soon as the component is dropped on the page.

Can someone help me on this.

 

Thanks,

Maheswari

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
santhosh_kumark
MVP

Likes

99 likes

Total Posts

111 posts

Correct reply

38 solutions
Top badges earned
Establish
Validate 1
Give Back 3
Give Back
Boost 50
View profile

Avatar
Establish
MVP
santhosh_kumark
MVP

Likes

99 likes

Total Posts

111 posts

Correct reply

38 solutions
Top badges earned
Establish
Validate 1
Give Back 3
Give Back
Boost 50
View profile
santhosh_kumark
MVP

17-09-2020

Hi @maheswariv26797 ,

 

When you drag and drop the component, the dialog does not even exist yet. When you open it, it fills with the default values provided by you in the dialog definition, and then, once you close it, POSTs them to the JCR so that you can see the effect.

To actually initialize the component with values using listener we need to create a proper content template. You can check here hope it helps: http://labs.sixdimensions.com/blog/2014-07-08/using-the-cq-template/

 

Answers (2)

Answers (2)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

606 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

606 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

17-09-2020

@maheswariv26797, can you please share your setup?
The dialogue configuration and also the dataset? 
At the meantime, check out this stack overflow post, https://stackoverflow.com/questions/41255582/drop-down-values-selected-in-classic-dialog-doesnt-show...

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

232 likes

Total Posts

294 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

232 likes

Total Posts

294 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile
Shashi_Mulugu
MVP

17-09-2020

@maheswariv26797 still using classic UI? 

 

Anyways to populate default values for a component on the page when you drag and drop, configuring default values in dialog will not suffice as it will only come into picture after author opens the dialog, if you want them to be displayed immediately after drag and drop, have to implement default cases in template either via sightly, sling model, wcmusepojo or JSP which ever you use for component templates.