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

Fetch the background Image from the dialog

Avatar

Level 2

 I need to add a background image field in the dialog so that it would be the background image for the component. How do I fetch it?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @maryanilak48011,

Please consider below dialog structure:

<imgPath
  jcr:primaryType="nt:unstructured"                                      
  sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"  
  fieldDescription="Select an image from path browser"
  fieldLabel="Browse Image"
  name="./imagePath" >
</imgPath>

Once the value is stored in dialog then you can fetch in HTL using:
${properties.imagePath} which will give the path of the selected image.

Hope this helps!

Jineet

1 Reply

Avatar

Correct answer by
Community Advisor

Hello @maryanilak48011,

Please consider below dialog structure:

<imgPath
  jcr:primaryType="nt:unstructured"                                      
  sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"  
  fieldDescription="Select an image from path browser"
  fieldLabel="Browse Image"
  name="./imagePath" >
</imgPath>

Once the value is stored in dialog then you can fetch in HTL using:
${properties.imagePath} which will give the path of the selected image.

Hope this helps!

Jineet