Default Values are not getting displayed when component is drag and dropped | Adobe Higher Education
Skip to main content
Level 2
September 17, 2020
Risolto

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

  • September 17, 2020
  • 3 risposte
  • 1765 visualizzazioni

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

Questo argomento è stato chiuso alle risposte.
Migliore risposta di santhosh_kumark

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/

 

3 risposte

santhosh_kumark
Level 6
September 17, 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/

 

Shashi_Mulugu
Community Advisor
Community Advisor
September 17, 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.

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 17, 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-same-value-in-touch-ui