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

Avatar

Avatar

maheswariv26797

Avatar

maheswariv26797

maheswariv26797

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

santhosh_kumark

Avatar

santhosh_kumark

santhosh_kumark

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

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

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

Shashi_Mulugu

MVP

Avatar

Shashi_Mulugu

MVP

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.