Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

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

Avatar

Level 5

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 5

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

View solution in original post

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 5

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