Expand my Community achievements bar.

Introducing Adobe LLM Optimizer: Own your brand’s presence in AI-Powered search and discovery

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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

AEM LinksLinkedIn

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

AEM LinksLinkedIn

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