loading clientlib for dialog | Community
Skip to main content
Level 6
Mar 15, 2021 10:22 AM UTC
Solved

loading clientlib for dialog

I have a clientlib with 3-4 js files in it in a component. I wanted 1 of those JS files to load for my dialog. I cant use extraClientlibs because that way all the JS will load for my dialog, whereas I specifically want only 1 particular file to load for my dialog. Is there a way to do this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Rohit_Utreja
Rohit_UtrejaAccepted solution
New Participant
Mar 15, 2021 11:46 AM UTC

@shaheena_sheikh ,

 

You can create a new clientlib and include that specific JS file in this new clientlib.

This new clientlib can be loaded while editing component through dialog and you can provide a category name for this clientlib as "cq.authoring.dialog".

 

If you want to be more specific while loading the js file for dialog validation. Please refer to below link for the same.

 

https://blogs.perficient.com/2017/11/06/aem-touch-ui-dialog-validation-new-best-practice-use-foundation-validation/

 

 

 

4 replies

VeenaVikraman
New Participant
Mar 15, 2021 5:36 PM UTC

I agree with @bhuwan_b  and @rohit_utreja , your best bet here is to create a clientLib specific for your component dialog including those JS which you need and then loading it to the dialog via extraClientLibs .

 

Thanks

Veena ✌

Translate
Bhuwan_B
New Participant
Mar 15, 2021 1:59 PM UTC

Create a new Client Library Folder with required Js file and add it to your dialog via extraClientlibs property.

https://wcmaem.blogspot.com/2016/08/how-to-load-touchui-dialog-specific.html

 

 

Translate
Rohit_Utreja
Rohit_UtrejaAccepted solution
New Participant
Mar 15, 2021 11:46 AM UTC

@shaheena_sheikh ,

 

You can create a new clientlib and include that specific JS file in this new clientlib.

This new clientlib can be loaded while editing component through dialog and you can provide a category name for this clientlib as "cq.authoring.dialog".

 

If you want to be more specific while loading the js file for dialog validation. Please refer to below link for the same.

 

https://blogs.perficient.com/2017/11/06/aem-touch-ui-dialog-validation-new-best-practice-use-foundation-validation/

 

 

 

Translate
Anudeep_Garnepudi
New Participant
Mar 15, 2021 11:23 AM UTC

@shaheena_sheikh 

Add the specific file with path in dialog clientlib js.txt

 

Translate