How to use Java script use function calling direct in the js file logic? | Community
Skip to main content
Var
New Participant
December 27, 2017
Solved

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

  • December 27, 2017
  • 4 replies
  • 3411 views

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.
Best answer by edubey

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
New Participant
January 4, 2018

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

edubey
New Participant
January 3, 2018

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

Var
VarAuthor
New Participant
January 2, 2018

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

edubey
edubeyAccepted solution
New Participant
December 28, 2017

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.