Touch UI - get current selected image path from Granite PickerDialog | Community
Skip to main content
vikashy47555224
Level 2
October 15, 2018
Solved

Touch UI - get current selected image path from Granite PickerDialog

  • October 15, 2018
  • 3 replies
  • 1668 views

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?

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

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

3 replies

smacdonald2008
Level 10
October 15, 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.

smacdonald2008
Level 10
October 15, 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

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
October 15, 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