Expand my Community achievements bar.

SOLVED

Touch UI - get current selected image path from Granite PickerDialog

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Level 10

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.

Avatar

Level 10

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

Correct answer by
Community Advisor

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