내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

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 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 5

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

원본 게시물의 솔루션 보기

3 답변 개

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

정확한 답변 작성자:
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