Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Default property is getting in the includeded component

Omi4
Level 1
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
Paul_McMahon
Correct answer by
Level 8
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
samthadhani
Level 3
Level 3

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

Paul_McMahon
Correct answer by
Level 8
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.