Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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

Avatar

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

Avatar

Community Advisor

Hi,

create selected property as String not Boolean.



Arun Patidar

Avatar

Level 5
Level 5

Even after changing to String property still same issue.

1662964_pastedImage_0.png

1662980_pastedImage_2.png

Avatar

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.



Arun Patidar

Avatar

Community Advisor

I tested in AEM 6.4, working fine.

Screenshot 2019-01-08 at 11.51.47 PM.png

chrome-capture (1).gif



Arun Patidar

Avatar

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>

Avatar

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>

Avatar

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.

Avatar

Level 10

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

Avatar

Community Advisor

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

Though you ca achieve this using javascript.



Arun Patidar