Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Default property is getting in the includeded component

Avatar

Level 1

Hello,

I am including a component(contact) at the time of page creation like below in the middle.jsp

<div class="span9 main-center" role="main"> 
<cq:include path="content-left" resourceType="foundation/components/parsys" />
<cq:include path="content-center" resourceType="components/content/test/contact"/>                        
</div>
I have one text in the dialog of  incude component its has default text value.I have successfully included a component but the component that i have included does work if and only if I open the dialog and click on ok button Even though I did not changed the text value.If i did not open the dialog of included component it does not works and text will not display default value in the included component section.please help what i am missing.Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 8

The default value you declare in dialog is not a default value for the component, it is the default value for the dialog. Until you have opened the dialog and hit save the component's JSP knows nothing about the default value. 

If you want a default value that is valid without the dialog being saved the better option is to not use the dialog, but to specify the default value in the JSP. 

View solution in original post

2 Replies

Avatar

Former Community Member

I don't understand why are you including a component.

Just use <cq:text property and there is placeholder in it which you can use and the values will be there on page load.

 

See this. https://dev.day.com/docs/en/cq/5-6/howto/taglib.html

Avatar

Correct answer by
Level 8

The default value you declare in dialog is not a default value for the component, it is the default value for the dialog. Until you have opened the dialog and hit save the component's JSP knows nothing about the default value. 

If you want a default value that is valid without the dialog being saved the better option is to not use the dialog, but to specify the default value in the JSP.