Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 7

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/

 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 7

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/

 

Avatar

Community Advisor

@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.

Avatar

Community Advisor

@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...