Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Issue with clientlibs in AEM 6.3 for categories cq.authoring.dialog

Avatar

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct Reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct Reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile
cquser1
Level 6

22-07-2017

Hi,

I want to write a custom jquery/js function for some hide/show manipulations in dialog.

If I place this in clientlibs folder[having categories String[] cq.authoring.dialog, dependencies String[] granite.jquery] which has js.txt[having name of custom js/jquery file] and the custom file.

If i just put  the below

$(document).ready(function() {

    alert('check');

});

in custom file,

alert is displayed when I refresh the page and not when I open dialog. Trying on this for quite some time now, but no luck. Shouldn't ideally this alert be displayed when I open the dialog rather than on page refresh.

Also, created the clientlibs folder at component level, but still the same behavior.

Not sure what is it that I am doing wrong. Any thoughts on this will be really helpful.

View Entire Topic

Avatar

Avatar
Boost 5
Level 4
zeeshank1500736
Level 4

Likes

29 likes

Total Posts

103 posts

Correct Reply

33 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 4
zeeshank1500736
Level 4

Likes

29 likes

Total Posts

103 posts

Correct Reply

33 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
zeeshank1500736
Level 4

23-07-2017

Hi

This is true you will see the alert on page load because all the authoring clientLibs is loading on pageload in authoring mode.So when you load the page all client lib will load that along with your ClientLib, you can not use directly $(document).ready(function() it will show the alert when you load.you have to bind some event with that id.So it will trigger only whrn particular event occur on particular id like onclick below is the sample.

$(document).ready(function(){

    $("p").click(function(){

        alert("The paragraph was clicked.");

    });

});

It will only occur when you click on p tag.

This thread will help you Show hide dialog fields based on selection in AEM 6.3

https://gist.github.com/rjspiker/003cf9eac1e853bb109a

Hope these will Help!