Touch UI - get current selected image path from Granite PickerDialog

Avatar

Avatar

vikashy47555224

Avatar

vikashy47555224

vikashy47555224

15-10-2018

Hi,

I am using AEM 6.3 SP1. I have touch UI component which has Pathfield to select images from DAM. In touch UI, how one can get the current selected image path from granite picker dialog on click of "Select" button?

1596251_pastedImage_0.png

For example, on click of "Select" button, I want to capture selected image path in jquery script.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

PuzanovsP

MVP

Avatar

PuzanovsP

MVP

PuzanovsP
MVP

15-10-2018

Hello Vikash,

You could add following Jquery to capture current selection:

$(".is-selected.foundation-selections-item").attr("data-foundation-collection-item-id") // returns the path to selected item

Regards,

Peter

Answers (2)

Answers (2)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

15-10-2018

See this article to learn how to work with JS API with HTL - it will get you up and running - Creating a Tab layout component for Adobe Experience Manager

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

15-10-2018

To capture any component dialog value in JS script - you should use  JS API with HTL. To read a dialog field - you use syntax like:

var mypath= properties.path;

where path is the name of the  Pathfield in the touch ui dialog.