Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

problems with granite.resources

Avatar

Level 1

Hi, excuse me, Im noob in AEM 6.3. I have a cq: Client Library Folder that contain a js with a function as shown below.

but it said "granite is not defined" when I try to get some property from the touch UI dialog like this:
var prueba = granite.resource.properties["showComercializable"];

where "showComercializable" its the name property in touch UI dialog.

thanks in advance

aem 3.PNGaem 4.PNGaem 2.PNG

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You need to create JS Use-API(server side JS) and use inside HTL, clientlibs are use for client side. Please check below.

HTL JavaScript Use-API

Thanks

Arun



Arun Patidar

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

You need to create JS Use-API(server side JS) and use inside HTL, clientlibs are use for client side. Please check below.

HTL JavaScript Use-API

Thanks

Arun



Arun Patidar

Avatar

Level 10

AFAIK, on client side there is no object with name granite but there is one with Granite

What are you trying to achieve, based on which I can recommend client/server side