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

cq included or sly included components dialog "selected" property is not respected for select drop down

Var
Level 5
Level 5

Steps to reproduce the issue.

  1. Add a drop down to the text component as shown below.

1662355_pastedImage_2.png

     2. add the selected property to one of the drop down list options ( Note :- Other than first option.)

1662362_pastedImage_3.png

  3. Include the Text component into the Title component as shown below. by using the

<div data-sly-resource="${'par' @ resourceType='/apps/core/wcm/components/text/v2/text'}"></div>

1662363_pastedImage_9.png

   4. Open any page http://localhost:4502/editor.html/content/we-retail/language-masters/en/men.html, add both the components (Text and Title Components) to the page as shown below.

1662364_pastedImage_14.png

5. Observe that the Individually added Text component dialog able to respect the "Selected" property but not the sly/cq included Text component

1662366_pastedImage_28.png

1662367_pastedImage_29.png

Observe the Issue : The sly/CQ included component is not able to load the "Selected" property option as the default value

10 Replies
Arun_Patidar
Community Advisor
Community Advisor

Hi,

create selected property as String not Boolean.

Var
Level 5
Level 5

Even after changing to String property still same issue.

1662964_pastedImage_0.png

1662980_pastedImage_2.png

Arun_Patidar
Community Advisor
Community Advisor

Hi,

What version are you using?

I tried in AEM 6.3 and working fine.

Screenshot 2019-01-08 at 10.12.21 PM.png

Screenshot 2019-01-08 at 10.12.35 PM.png

However the values won't be render in page until you submit dialog.

Var
Level 5
Level 5

Strange, have you included the component by using below sly include .?

<div data-sly-resource="${'par' @ resourceType='/apps/core/wcm/components/text/v2/text'}"></div>

smacdonald2008
Level 10
Level 10

Select field in a component dialog works fine - see this article -- Building Experience Manager Components using Granite/Coral Resource Types

Also - to display the value of a select value in a component - you need to write code  - like this where name of Select field is path (all discussed in the above article):

<div>

<p>This is your AEM HTML Template Language component:</p>

      <h1>${properties.heading}</h1>

       <p>${properties.description}</p>

       <p>The following values are the resource types added to the dialog</p>

      <p><b>Selected Path value:</b> ${properties.path}</p>

       <p>

            <b>Date:</b>

                  ${'yyyy-MM-dd HH:mm:ss.SSSXXX' @ format=properties.startdate, timezone='UTC'}

        </p>

        <p>

            <b>Size:</b> ${properties.size}

        </p>

        <p>

            <b>Checkbox:</b> ${properties.show}

        </p>

</div>

Var
Level 5
Level 5

Hi smacdonald2008​,

I i stated in the use case steps, it is not working when i am including the component into another component by CQ/Sly include.

smacdonald2008
Level 10
Level 10

We do not cover a component in a component in that article - simply building HTL components that use these Granite resource types.

Arun_Patidar
Community Advisor
Community Advisor

Yes, It is not working when add component directly in HTL.

Though you ca achieve this using javascript.