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

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

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

해결됨

How to make core component (download component v2) to show/hide "file size" property with a checkbox reference

Avatar

Level 2

I am working with one of the core component (download component v2).

 

When I author the dialog with any file, it shows file name, file size along with download option.

 

My requirement is that, I have added a checkbox under properties tab under download component.

 

When checkbox is selected while authoring, only then the file size property should show up, and if checkbox is not selected, it should not show file size info for download component.

 

I have added checkbox under properties tab of download component and wrote a slingmodel to get the checkbox node property to sling model.

 

Can someone let me know how can I get the desired result as mentioned above from here Please? Also help me with code to accomplish this requirement? Thanks in advance!

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

Hi @srk381 

 

There is a getFileSize method in components: https://github.com/adobe/aem-core-wcm-components/blob/525cbab6e5a1bd5a8628da7217328fd80016a5c1/bundl.... Simply you can delegate your model and show and hide the value it is returning on your custom method.

 

Delegating: https://kiransg.com/2021/11/07/aem-core-component-delegation/

Kiran_Vedantam_0-1673299080441.png

 

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Community Advisor

Hi @srk381 

 

There is a getFileSize method in components: https://github.com/adobe/aem-core-wcm-components/blob/525cbab6e5a1bd5a8628da7217328fd80016a5c1/bundl.... Simply you can delegate your model and show and hide the value it is returning on your custom method.

 

Delegating: https://kiransg.com/2021/11/07/aem-core-component-delegation/

Kiran_Vedantam_0-1673299080441.png