Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

How to use Java script use function calling direct in the js file logic?

Avatar

Level 5
Level 5

AM doing a customization of touch UI dialog where i am using some of the function in the dialog events. like below code. Where as i want to use the use function of JavaScript API to call some of the AdaptTo mechanism and use it in the Jquery level code. Will it be possible or it is tightly coupled with sightly framework alone..?

$document.on("dialog-ready", function() {

        document.querySelector('form.cq-dialog').addEventListener('submit', function(){

            //$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, selector [form.cq-dialog]");

        }, true);

    });

1 Accepted Solution

Avatar

Correct answer by
Level 10

AFAIK, you cannot.

These things are executed at different level. Javascript (at browser) and JS USE (at server)

What's your use case, there may be better alternative solution available.

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

AFAIK, you cannot.

These things are executed at different level. Javascript (at browser) and JS USE (at server)

What's your use case, there may be better alternative solution available.

Avatar

Level 5
Level 5

Hi edubey,

My use-case is to bring the image properties in the dialog authoring to showcase the path, size, mimeType, etc meta properties.

The below article helps a little to bring image path as it is already available in the page rendition as a html tag. but i need some more infor which i want to retrieve at Touch UI dialog load or some other dialog event listeners.

Image Path in Touch UI dialog (AEM 6.1 and AEM 6.2)

..

VAr

Avatar

Level 10

With the mentioned article you have already got the path to the image in DAM, you can make a request to that jcr:content of that image to read the properties/metadata and display it any preferred format/UI

Avatar

Level 5
Level 5

can i do this request in JAVA SCRIPT USE API function, if we can, can you show some limelight on it with an example.?