How to use Java script use function calling direct in the js file logic? | Community
Skip to main content
Var
Level 4
Dec 27, 2017 7:39 PM UTC
Solved

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

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);

    });

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Dec 28, 2017 5:46 AM UTC

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.

4 replies

Var
VarAuthor
Level 4
Jan 4, 2018 8:06 PM UTC

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

Translate
edubey
Level 10
Jan 3, 2018 9:08 AM UTC

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

Translate
Var
VarAuthor
Level 4
Jan 2, 2018 11:04 PM UTC

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

Translate
edubey
edubeyAccepted solution
Level 10
Dec 28, 2017 5:46 AM UTC

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.

Translate