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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How to get cq:dialog dropdown checked value in html and javascript

Avatar

Level 4

I am using a dropdown in cq:dialog with two fields as shown below in the picture: 

Screenshot from 2022-11-04 09-03-30.png

The problem is that I want to get the selected value in html and javascript but not able to access those values. I tried using ${properties.propertyName} but it didn't work. Is there a way I can check which value is checked? 

1 Accepted Solution

Avatar

Correct answer by
Level 4

It's solved, just needed ${properties.propertyName}. Before this, I was using ${properties.nodeName}

3 Replies

Avatar

Community Advisor

@nikita24tailor Check if the property with selected value is persisted to JCR when you submitted the dialog in CRXDE -  http://localhost:4502/crx/de/index.jsp#/content/PAGE_PATH/jcr:content/COMPONENT_PATH 

Avatar

Correct answer by
Level 4

It's solved, just needed ${properties.propertyName}. Before this, I was using ${properties.nodeName}

Avatar

Level 3

Hi @nikita24tailor ,

Try to implement a slingmodel for that particular resource and using @valuemap attribute mapping, map that value with getter method and read the same in sightly.

Article for reference :
https://sourcedcode.com/blog/aem/aem-sling-model-injectors-annotations-cheat-sheet-reference-guide